History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next

Alexei Starovoitov says: ==================== pull-request: bpf-next 2021-12-30 The following pull-request contains BPF updates for your *net-next* tree. We've added 72 non-merge commits during the last 20 day(s) which contain a total of 223 files changed, 3510 insertions(+), 1591 deletions(-). The main changes are: 1) Automatic setrlimit in libbpf when bpf is memcg's in the kernel, from Andrii. 2) Beautify and de-verbose verifier logs, from Christy. 3) Composable verifier types, from Hao. 4) bpf_strncmp helper, from Hou. 5) bpf.h header dependency cleanup, from Jakub. 6) get_func_[arg|ret|arg_cnt] helpers, from Jiri. 7) Sleepable local storage, from KP. 8) Extend kfunc with PTR_TO_CTX, PTR_TO_MEM argument support, from Kumar. ====================

David S. Miller committed 4 years ago

Commit e63a0232 parents ce2b6eb 9e6b19a221 files · +3506 −1591Browse files

Showing the changes to net (39 of 221 files). Show all

Unified · Split

39 files
  1. net/bluetooth/bnep/sock.c +1 −0
  2. net/bluetooth/eir.h +2 −0
  3. net/bluetooth/hidp/sock.c +1 −0
  4. net/bluetooth/l2cap_sock.c +1 −0
  5. net/bridge/br_ioctl.c +1 −0
  6. net/caif/caif_socket.c +1 −0
  7. net/core/bpf_sk_storage.c +8 −2
  8. net/core/dev.c +1 −1
  9. net/core/devlink.c +1 −0
  10. net/core/filter.c +36 −36
  11. net/core/flow_dissector.c +1 −0
  12. net/core/lwt_bpf.c +1 −0
  13. net/core/sock_diag.c +1 −0
  14. net/core/sock_map.c +1 −1
  15. net/core/sysctl_net_core.c +1 −0
  16. net/decnet/dn_nsp_in.c +1 −0
  17. net/dsa/dsa_priv.h +1 −0
  18. net/ethtool/ioctl.c +1 −0
  19. net/ipv4/nexthop.c +1 −0
  20. net/ipv4/udp.c +1 −0
  21. net/ipv6/ip6_fib.c +1 −0
  22. net/ipv6/seg6_local.c +1 −0
  23. net/ipv6/udp.c +1 −0
  24. net/iucv/af_iucv.c +1 −0
  25. net/kcm/kcmsock.c +1 −0
  26. net/netfilter/nfnetlink_hook.c +1 −0
  27. net/netfilter/nft_reject_netdev.c +1 −0
  28. net/netlink/af_netlink.c +2 −0
  29. net/packet/af_packet.c +1 −0
  30. net/rose/rose_in.c +1 −0
  31. net/sched/sch_frag.c +1 −0
  32. net/smc/smc_ib.c +2 −0
  33. net/smc/smc_ism.c +1 −0
  34. net/socket.c +1 −0
  35. net/unix/af_unix.c +1 −0
  36. net/vmw_vsock/af_vsock.c +1 −0
  37. net/xdp/xskmap.c +1 −0
  38. net/xfrm/xfrm_state.c +1 −0
  39. net/xfrm/xfrm_user.c +1 −0
net/bluetooth/bnep/sock.c+1−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 SOFTWARE IS DISCLAIMED.
2525 */
2626
27+#include <linux/compat.h>
2728 #include <linux/export.h>
2829 #include <linux/file.h>
2930
net/bluetooth/eir.h+2−0
@@ -5,6 +5,8 @@ · 4 unmodified lines
55 * Copyright (C) 2021 Intel Corporation
66 */
77
8+#include <asm/unaligned.h>
9+
810 void eir_create(struct hci_dev *hdev, u8 *data);
911
1012 u8 eir_create_adv_data(struct hci_dev *hdev, u8 instance, u8 *ptr);
net/bluetooth/hidp/sock.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 SOFTWARE IS DISCLAIMED.
2121 */
2222
23+#include <linux/compat.h>
2324 #include <linux/export.h>
2425 #include <linux/file.h>
2526
net/bluetooth/l2cap_sock.c+1−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929
3030 #include <linux/module.h>
3131 #include <linux/export.h>
32+#include <linux/filter.h>
3233 #include <linux/sched/signal.h>
3334
3435 #include <net/bluetooth/bluetooth.h>
net/bridge/br_ioctl.c+1−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 */
99
1010 #include <linux/capability.h>
11+#include <linux/compat.h>
1112 #include <linux/kernel.h>
1213 #include <linux/if_bridge.h>
1314 #include <linux/netdevice.h>
net/caif/caif_socket.c+1−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66
77 #define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__
88
9+#include <linux/filter.h>
910 #include <linux/fs.h>
1011 #include <linux/init.h>
1112 #include <linux/module.h>
net/core/bpf_sk_storage.c+8−2
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <net/sock.h>
1414 #include <uapi/linux/sock_diag.h>
1515 #include <uapi/linux/btf.h>
16+#include <linux/rcupdate_trace.h>
1617
1718 DEFINE_BPF_STORAGE_CACHE(sk_cache);
1819
@@ -22,7 +23,8 @@ bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit) · 3 unmodified lines
2223 struct bpf_local_storage *sk_storage;
2324 struct bpf_local_storage_map *smap;
2425
25− sk_storage = rcu_dereference(sk->sk_bpf_storage);
26+ sk_storage =
27+ rcu_dereference_check(sk->sk_bpf_storage, bpf_rcu_lock_held());
2628 if (!sk_storage)
2729 return NULL;
2830
@@ -258,6 +260,7 @@ BPF_CALL_4(bpf_sk_storage_get, struct bpf_map *, map, struct sock *, sk, · 229 unmodified lines
258260 {
259261 struct bpf_local_storage_data *sdata;
260262
263+ WARN_ON_ONCE(!bpf_rcu_lock_held());
261264 if (!sk || !sk_fullsock(sk) || flags > BPF_SK_STORAGE_GET_F_CREATE)
262265 return (unsigned long)NULL;
263266
@@ -288,6 +291,7 @@ BPF_CALL_4(bpf_sk_storage_get, struct bpf_map *, map, struct sock *, sk, · 24 unmodified lines
288291
289292 BPF_CALL_2(bpf_sk_storage_delete, struct bpf_map *, map, struct sock *, sk)
290293 {
294+ WARN_ON_ONCE(!bpf_rcu_lock_held());
291295 if (!sk || !sk_fullsock(sk))
292296 return -EINVAL;
293297
@@ -416,6 +420,7 @@ static bool bpf_sk_storage_tracing_allowed(const struct bpf_prog *prog) · 122 unmodified lines
416420 BPF_CALL_4(bpf_sk_storage_get_tracing, struct bpf_map *, map, struct sock *, sk,
417421 void *, value, u64, flags)
418422 {
423+ WARN_ON_ONCE(!bpf_rcu_lock_held());
419424 if (in_hardirq() || in_nmi())
420425 return (unsigned long)NULL;
421426
@@ -425,6 +430,7 @@ BPF_CALL_4(bpf_sk_storage_get_tracing, struct bpf_map *, map, struct sock *, sk, · 3 unmodified lines
425430 BPF_CALL_2(bpf_sk_storage_delete_tracing, struct bpf_map *, map,
426431 struct sock *, sk)
427432 {
433+ WARN_ON_ONCE(!bpf_rcu_lock_held());
428434 if (in_hardirq() || in_nmi())
429435 return -EPERM;
430436
@@ -929,7 +935,7 @@ static struct bpf_iter_reg bpf_sk_storage_map_reg_info = { · 498 unmodified lines
929935 { offsetof(struct bpf_iter__bpf_sk_storage_map, sk),
930936 PTR_TO_BTF_ID_OR_NULL },
931937 { offsetof(struct bpf_iter__bpf_sk_storage_map, value),
932− PTR_TO_RDWR_BUF_OR_NULL },
938+ PTR_TO_BUF | PTR_MAYBE_NULL },
933939 },
934940 .seq_info = &iter_seq_info,
935941 };
net/core/dev.c+1−1
@@ -4712,7 +4712,7 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb, · 4711 unmodified lines
47124712 case XDP_PASS:
47134713 break;
47144714 default:
4715− bpf_warn_invalid_xdp_action(act);
4715+ bpf_warn_invalid_xdp_action(skb->dev, xdp_prog, act);
47164716 fallthrough;
47174717 case XDP_ABORTED:
47184718 trace_xdp_exception(skb->dev, xdp_prog, act);
net/core/devlink.c+1−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 * Copyright (c) 2016 Jiri Pirko <jiri@mellanox.com>
88 */
99
10+#include <linux/etherdevice.h>
1011 #include <linux/kernel.h>
1112 #include <linux/module.h>
1213 #include <linux/types.h>
net/core/filter.c+36−36
@@ -1712,7 +1712,7 @@ static const struct bpf_func_proto bpf_skb_store_bytes_proto = { · 1711 unmodified lines
17121712 .ret_type = RET_INTEGER,
17131713 .arg1_type = ARG_PTR_TO_CTX,
17141714 .arg2_type = ARG_ANYTHING,
1715− .arg3_type = ARG_PTR_TO_MEM,
1715+ .arg3_type = ARG_PTR_TO_MEM | MEM_RDONLY,
17161716 .arg4_type = ARG_CONST_SIZE,
17171717 .arg5_type = ARG_ANYTHING,
17181718 };
@@ -2017,9 +2017,9 @@ static const struct bpf_func_proto bpf_csum_diff_proto = { · 298 unmodified lines
20172017 .gpl_only = false,
20182018 .pkt_access = true,
20192019 .ret_type = RET_INTEGER,
2020− .arg1_type = ARG_PTR_TO_MEM_OR_NULL,
2020+ .arg1_type = ARG_PTR_TO_MEM | PTR_MAYBE_NULL | MEM_RDONLY,
20212021 .arg2_type = ARG_CONST_SIZE_OR_ZERO,
2022− .arg3_type = ARG_PTR_TO_MEM_OR_NULL,
2022+ .arg3_type = ARG_PTR_TO_MEM | PTR_MAYBE_NULL | MEM_RDONLY,
20232023 .arg4_type = ARG_CONST_SIZE_OR_ZERO,
20242024 .arg5_type = ARG_ANYTHING,
20252025 };
@@ -2540,7 +2540,7 @@ static const struct bpf_func_proto bpf_redirect_neigh_proto = { · 514 unmodified lines
25402540 .gpl_only = false,
25412541 .ret_type = RET_INTEGER,
25422542 .arg1_type = ARG_ANYTHING,
2543− .arg2_type = ARG_PTR_TO_MEM_OR_NULL,
2543+ .arg2_type = ARG_PTR_TO_MEM | PTR_MAYBE_NULL | MEM_RDONLY,
25442544 .arg3_type = ARG_CONST_SIZE_OR_ZERO,
25452545 .arg4_type = ARG_ANYTHING,
25462546 };
@@ -4173,7 +4173,7 @@ static const struct bpf_func_proto bpf_skb_event_output_proto = { · 1626 unmodified lines
41734173 .arg1_type = ARG_PTR_TO_CTX,
41744174 .arg2_type = ARG_CONST_MAP_PTR,
41754175 .arg3_type = ARG_ANYTHING,
4176− .arg4_type = ARG_PTR_TO_MEM,
4176+ .arg4_type = ARG_PTR_TO_MEM | MEM_RDONLY,
41774177 .arg5_type = ARG_CONST_SIZE_OR_ZERO,
41784178 };
41794179
@@ -4187,7 +4187,7 @@ const struct bpf_func_proto bpf_skb_output_proto = { · 7 unmodified lines
41874187 .arg1_btf_id = &bpf_skb_output_btf_ids[0],
41884188 .arg2_type = ARG_CONST_MAP_PTR,
41894189 .arg3_type = ARG_ANYTHING,
4190− .arg4_type = ARG_PTR_TO_MEM,
4190+ .arg4_type = ARG_PTR_TO_MEM | MEM_RDONLY,
41914191 .arg5_type = ARG_CONST_SIZE_OR_ZERO,
41924192 };
41934193
@@ -4370,7 +4370,7 @@ static const struct bpf_func_proto bpf_skb_set_tunnel_key_proto = { · 176 unmodified lines
43704370 .gpl_only = false,
43714371 .ret_type = RET_INTEGER,
43724372 .arg1_type = ARG_PTR_TO_CTX,
4373− .arg2_type = ARG_PTR_TO_MEM,
4373+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
43744374 .arg3_type = ARG_CONST_SIZE,
43754375 .arg4_type = ARG_ANYTHING,
43764376 };
@@ -4396,7 +4396,7 @@ static const struct bpf_func_proto bpf_skb_set_tunnel_opt_proto = { · 19 unmodified lines
43964396 .gpl_only = false,
43974397 .ret_type = RET_INTEGER,
43984398 .arg1_type = ARG_PTR_TO_CTX,
4399− .arg2_type = ARG_PTR_TO_MEM,
4399+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
44004400 .arg3_type = ARG_CONST_SIZE,
44014401 };
44024402
@@ -4566,7 +4566,7 @@ static const struct bpf_func_proto bpf_xdp_event_output_proto = { · 163 unmodified lines
45664566 .arg1_type = ARG_PTR_TO_CTX,
45674567 .arg2_type = ARG_CONST_MAP_PTR,
45684568 .arg3_type = ARG_ANYTHING,
4569− .arg4_type = ARG_PTR_TO_MEM,
4569+ .arg4_type = ARG_PTR_TO_MEM | MEM_RDONLY,
45704570 .arg5_type = ARG_CONST_SIZE_OR_ZERO,
45714571 };
45724572
@@ -4580,7 +4580,7 @@ const struct bpf_func_proto bpf_xdp_output_proto = { · 7 unmodified lines
45804580 .arg1_btf_id = &bpf_xdp_output_btf_ids[0],
45814581 .arg2_type = ARG_CONST_MAP_PTR,
45824582 .arg3_type = ARG_ANYTHING,
4583− .arg4_type = ARG_PTR_TO_MEM,
4583+ .arg4_type = ARG_PTR_TO_MEM | MEM_RDONLY,
45844584 .arg5_type = ARG_CONST_SIZE_OR_ZERO,
45854585 };
45864586
@@ -5066,7 +5066,7 @@ const struct bpf_func_proto bpf_sk_setsockopt_proto = { · 479 unmodified lines
50665066 .arg1_type = ARG_PTR_TO_BTF_ID_SOCK_COMMON,
50675067 .arg2_type = ARG_ANYTHING,
50685068 .arg3_type = ARG_ANYTHING,
5069− .arg4_type = ARG_PTR_TO_MEM,
5069+ .arg4_type = ARG_PTR_TO_MEM | MEM_RDONLY,
50705070 .arg5_type = ARG_CONST_SIZE,
50715071 };
50725072
@@ -5100,7 +5100,7 @@ static const struct bpf_func_proto bpf_sock_addr_setsockopt_proto = { · 27 unmodified lines
51005100 .arg1_type = ARG_PTR_TO_CTX,
51015101 .arg2_type = ARG_ANYTHING,
51025102 .arg3_type = ARG_ANYTHING,
5103− .arg4_type = ARG_PTR_TO_MEM,
5103+ .arg4_type = ARG_PTR_TO_MEM | MEM_RDONLY,
51045104 .arg5_type = ARG_CONST_SIZE,
51055105 };
51065106
@@ -5134,7 +5134,7 @@ static const struct bpf_func_proto bpf_sock_ops_setsockopt_proto = { · 27 unmodified lines
51345134 .arg1_type = ARG_PTR_TO_CTX,
51355135 .arg2_type = ARG_ANYTHING,
51365136 .arg3_type = ARG_ANYTHING,
5137− .arg4_type = ARG_PTR_TO_MEM,
5137+ .arg4_type = ARG_PTR_TO_MEM | MEM_RDONLY,
51385138 .arg5_type = ARG_CONST_SIZE,
51395139 };
51405140
@@ -5309,7 +5309,7 @@ static const struct bpf_func_proto bpf_bind_proto = { · 168 unmodified lines
53095309 .gpl_only = false,
53105310 .ret_type = RET_INTEGER,
53115311 .arg1_type = ARG_PTR_TO_CTX,
5312− .arg2_type = ARG_PTR_TO_MEM,
5312+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
53135313 .arg3_type = ARG_CONST_SIZE,
53145314 };
53155315
@@ -5897,7 +5897,7 @@ static const struct bpf_func_proto bpf_lwt_in_push_encap_proto = { · 581 unmodified lines
58975897 .ret_type = RET_INTEGER,
58985898 .arg1_type = ARG_PTR_TO_CTX,
58995899 .arg2_type = ARG_ANYTHING,
5900− .arg3_type = ARG_PTR_TO_MEM,
5900+ .arg3_type = ARG_PTR_TO_MEM | MEM_RDONLY,
59015901 .arg4_type = ARG_CONST_SIZE
59025902 };
59035903
@@ -5907,7 +5907,7 @@ static const struct bpf_func_proto bpf_lwt_xmit_push_encap_proto = { · 3 unmodified lines
59075907 .ret_type = RET_INTEGER,
59085908 .arg1_type = ARG_PTR_TO_CTX,
59095909 .arg2_type = ARG_ANYTHING,
5910− .arg3_type = ARG_PTR_TO_MEM,
5910+ .arg3_type = ARG_PTR_TO_MEM | MEM_RDONLY,
59115911 .arg4_type = ARG_CONST_SIZE
59125912 };
59135913
@@ -5950,7 +5950,7 @@ static const struct bpf_func_proto bpf_lwt_seg6_store_bytes_proto = { · 36 unmodified lines
59505950 .ret_type = RET_INTEGER,
59515951 .arg1_type = ARG_PTR_TO_CTX,
59525952 .arg2_type = ARG_ANYTHING,
5953− .arg3_type = ARG_PTR_TO_MEM,
5953+ .arg3_type = ARG_PTR_TO_MEM | MEM_RDONLY,
59545954 .arg4_type = ARG_CONST_SIZE
59555955 };
59565956
@@ -6038,7 +6038,7 @@ static const struct bpf_func_proto bpf_lwt_seg6_action_proto = { · 81 unmodified lines
60386038 .ret_type = RET_INTEGER,
60396039 .arg1_type = ARG_PTR_TO_CTX,
60406040 .arg2_type = ARG_ANYTHING,
6041− .arg3_type = ARG_PTR_TO_MEM,
6041+ .arg3_type = ARG_PTR_TO_MEM | MEM_RDONLY,
60426042 .arg4_type = ARG_CONST_SIZE
60436043 };
60446044
@@ -6263,7 +6263,7 @@ static const struct bpf_func_proto bpf_skc_lookup_tcp_proto = { · 218 unmodified lines
62636263 .pkt_access = true,
62646264 .ret_type = RET_PTR_TO_SOCK_COMMON_OR_NULL,
62656265 .arg1_type = ARG_PTR_TO_CTX,
6266− .arg2_type = ARG_PTR_TO_MEM,
6266+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
62676267 .arg3_type = ARG_CONST_SIZE,
62686268 .arg4_type = ARG_ANYTHING,
62696269 .arg5_type = ARG_ANYTHING,
@@ -6282,7 +6282,7 @@ static const struct bpf_func_proto bpf_sk_lookup_tcp_proto = { · 12 unmodified lines
62826282 .pkt_access = true,
62836283 .ret_type = RET_PTR_TO_SOCKET_OR_NULL,
62846284 .arg1_type = ARG_PTR_TO_CTX,
6285− .arg2_type = ARG_PTR_TO_MEM,
6285+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
62866286 .arg3_type = ARG_CONST_SIZE,
62876287 .arg4_type = ARG_ANYTHING,
62886288 .arg5_type = ARG_ANYTHING,
@@ -6301,7 +6301,7 @@ static const struct bpf_func_proto bpf_sk_lookup_udp_proto = { · 12 unmodified lines
63016301 .pkt_access = true,
63026302 .ret_type = RET_PTR_TO_SOCKET_OR_NULL,
63036303 .arg1_type = ARG_PTR_TO_CTX,
6304− .arg2_type = ARG_PTR_TO_MEM,
6304+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
63056305 .arg3_type = ARG_CONST_SIZE,
63066306 .arg4_type = ARG_ANYTHING,
63076307 .arg5_type = ARG_ANYTHING,
@@ -6338,7 +6338,7 @@ static const struct bpf_func_proto bpf_xdp_sk_lookup_udp_proto = { · 30 unmodified lines
63386338 .pkt_access = true,
63396339 .ret_type = RET_PTR_TO_SOCKET_OR_NULL,
63406340 .arg1_type = ARG_PTR_TO_CTX,
6341− .arg2_type = ARG_PTR_TO_MEM,
6341+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
63426342 .arg3_type = ARG_CONST_SIZE,
63436343 .arg4_type = ARG_ANYTHING,
63446344 .arg5_type = ARG_ANYTHING,
@@ -6361,7 +6361,7 @@ static const struct bpf_func_proto bpf_xdp_skc_lookup_tcp_proto = { · 16 unmodified lines
63616361 .pkt_access = true,
63626362 .ret_type = RET_PTR_TO_SOCK_COMMON_OR_NULL,
63636363 .arg1_type = ARG_PTR_TO_CTX,
6364− .arg2_type = ARG_PTR_TO_MEM,
6364+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
63656365 .arg3_type = ARG_CONST_SIZE,
63666366 .arg4_type = ARG_ANYTHING,
63676367 .arg5_type = ARG_ANYTHING,
@@ -6384,7 +6384,7 @@ static const struct bpf_func_proto bpf_xdp_sk_lookup_tcp_proto = { · 16 unmodified lines
63846384 .pkt_access = true,
63856385 .ret_type = RET_PTR_TO_SOCKET_OR_NULL,
63866386 .arg1_type = ARG_PTR_TO_CTX,
6387− .arg2_type = ARG_PTR_TO_MEM,
6387+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
63886388 .arg3_type = ARG_CONST_SIZE,
63896389 .arg4_type = ARG_ANYTHING,
63906390 .arg5_type = ARG_ANYTHING,
@@ -6403,7 +6403,7 @@ static const struct bpf_func_proto bpf_sock_addr_skc_lookup_tcp_proto = { · 12 unmodified lines
64036403 .gpl_only = false,
64046404 .ret_type = RET_PTR_TO_SOCK_COMMON_OR_NULL,
64056405 .arg1_type = ARG_PTR_TO_CTX,
6406− .arg2_type = ARG_PTR_TO_MEM,
6406+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
64076407 .arg3_type = ARG_CONST_SIZE,
64086408 .arg4_type = ARG_ANYTHING,
64096409 .arg5_type = ARG_ANYTHING,
@@ -6422,7 +6422,7 @@ static const struct bpf_func_proto bpf_sock_addr_sk_lookup_tcp_proto = { · 12 unmodified lines
64226422 .gpl_only = false,
64236423 .ret_type = RET_PTR_TO_SOCKET_OR_NULL,
64246424 .arg1_type = ARG_PTR_TO_CTX,
6425− .arg2_type = ARG_PTR_TO_MEM,
6425+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
64266426 .arg3_type = ARG_CONST_SIZE,
64276427 .arg4_type = ARG_ANYTHING,
64286428 .arg5_type = ARG_ANYTHING,
@@ -6441,7 +6441,7 @@ static const struct bpf_func_proto bpf_sock_addr_sk_lookup_udp_proto = { · 12 unmodified lines
64416441 .gpl_only = false,
64426442 .ret_type = RET_PTR_TO_SOCKET_OR_NULL,
64436443 .arg1_type = ARG_PTR_TO_CTX,
6444− .arg2_type = ARG_PTR_TO_MEM,
6444+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
64456445 .arg3_type = ARG_CONST_SIZE,
64466446 .arg4_type = ARG_ANYTHING,
64476447 .arg5_type = ARG_ANYTHING,
@@ -6754,9 +6754,9 @@ static const struct bpf_func_proto bpf_tcp_check_syncookie_proto = { · 306 unmodified lines
67546754 .pkt_access = true,
67556755 .ret_type = RET_INTEGER,
67566756 .arg1_type = ARG_PTR_TO_BTF_ID_SOCK_COMMON,
6757− .arg2_type = ARG_PTR_TO_MEM,
6757+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
67586758 .arg3_type = ARG_CONST_SIZE,
6759− .arg4_type = ARG_PTR_TO_MEM,
6759+ .arg4_type = ARG_PTR_TO_MEM | MEM_RDONLY,
67606760 .arg5_type = ARG_CONST_SIZE,
67616761 };
67626762
@@ -6823,9 +6823,9 @@ static const struct bpf_func_proto bpf_tcp_gen_syncookie_proto = { · 60 unmodified lines
68236823 .pkt_access = true,
68246824 .ret_type = RET_INTEGER,
68256825 .arg1_type = ARG_PTR_TO_BTF_ID_SOCK_COMMON,
6826− .arg2_type = ARG_PTR_TO_MEM,
6826+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
68276827 .arg3_type = ARG_CONST_SIZE,
6828− .arg4_type = ARG_PTR_TO_MEM,
6828+ .arg4_type = ARG_PTR_TO_MEM | MEM_RDONLY,
68296829 .arg5_type = ARG_CONST_SIZE,
68306830 };
68316831
@@ -7054,7 +7054,7 @@ static const struct bpf_func_proto bpf_sock_ops_store_hdr_opt_proto = { · 222 unmodified lines
70547054 .gpl_only = false,
70557055 .ret_type = RET_INTEGER,
70567056 .arg1_type = ARG_PTR_TO_CTX,
7057− .arg2_type = ARG_PTR_TO_MEM,
7057+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
70587058 .arg3_type = ARG_CONST_SIZE,
70597059 .arg4_type = ARG_ANYTHING,
70607060 };
@@ -8180,13 +8180,13 @@ static bool xdp_is_valid_access(int off, int size, · 1119 unmodified lines
81808180 return __is_valid_xdp_access(off, size);
81818181 }
81828182
8183−void bpf_warn_invalid_xdp_action(u32 act)
8183+void bpf_warn_invalid_xdp_action(struct net_device *dev, struct bpf_prog *prog, u32 act)
81848184 {
81858185 const u32 act_max = XDP_REDIRECT;
81868186
8187− WARN_ONCE(1, "%s XDP return value %u, expect packet loss!\n",
8188− act > act_max ? "Illegal" : "Driver unsupported",
8189− act);
8187+ pr_warn_once("%s XDP return value %u on prog %s (id %d) dev %s, expect packet loss!\n",
8188+ act > act_max ? "Illegal" : "Driver unsupported",
8189+ act, prog->aux->name, prog->aux->id, dev ? dev->name : "N/A");
81908190 }
81918191 EXPORT_SYMBOL_GPL(bpf_warn_invalid_xdp_action);
81928192
net/core/flow_dissector.c+1−0
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 #include <linux/ip.h>
66 #include <linux/ipv6.h>
77 #include <linux/if_vlan.h>
8+#include <linux/filter.h>
89 #include <net/dsa.h>
910 #include <net/dst_metadata.h>
1011 #include <net/ip.h>
net/core/lwt_bpf.c+1−0
@@ -2,6 +2,7 @@ · 1 unmodified line
22 /* Copyright (c) 2016 Thomas Graf <tgraf@tgraf.ch>
33 */
44
5+#include <linux/filter.h>
56 #include <linux/kernel.h>
67 #include <linux/module.h>
78 #include <linux/skbuff.h>
net/core/sock_diag.c+1−0
@@ -1,5 +1,6 @@
11 /* License: GPL */
22
3+#include <linux/filter.h>
34 #include <linux/mutex.h>
45 #include <linux/socket.h>
56 #include <linux/skbuff.h>
net/core/sock_map.c+1−1
@@ -1564,7 +1564,7 @@ static struct bpf_iter_reg sock_map_iter_reg = { · 1563 unmodified lines
15641564 .ctx_arg_info_size = 2,
15651565 .ctx_arg_info = {
15661566 { offsetof(struct bpf_iter__sockmap, key),
1567− PTR_TO_RDONLY_BUF_OR_NULL },
1567+ PTR_TO_BUF | PTR_MAYBE_NULL | MEM_RDONLY },
15681568 { offsetof(struct bpf_iter__sockmap, sk),
15691569 PTR_TO_BTF_ID_OR_NULL },
15701570 },
net/core/sysctl_net_core.c+1−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 * Added /proc/sys/net/core directory entry (empty =) ). [MS]
77 */
88
9+#include <linux/filter.h>
910 #include <linux/mm.h>
1011 #include <linux/sysctl.h>
1112 #include <linux/module.h>
net/decnet/dn_nsp_in.c+1−0
@@ -38,6 +38,7 @@ · 37 unmodified lines
3838 *******************************************************************************/
3939
4040 #include <linux/errno.h>
41+#include <linux/filter.h>
4142 #include <linux/types.h>
4243 #include <linux/socket.h>
4344 #include <linux/in.h>
net/dsa/dsa_priv.h+1−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 #define __DSA_PRIV_H
99
1010 #include <linux/if_bridge.h>
11+#include <linux/if_vlan.h>
1112 #include <linux/phy.h>
1213 #include <linux/netdevice.h>
1314 #include <linux/netpoll.h>
net/ethtool/ioctl.c+1−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 */
99
1010 #include <linux/compat.h>
11+#include <linux/etherdevice.h>
1112 #include <linux/module.h>
1213 #include <linux/types.h>
1314 #include <linux/capability.h>
net/ipv4/nexthop.c+1−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 #include <linux/nexthop.h>
99 #include <linux/rtnetlink.h>
1010 #include <linux/slab.h>
11+#include <linux/vmalloc.h>
1112 #include <net/arp.h>
1213 #include <net/ipv6_stubs.h>
1314 #include <net/lwtunnel.h>
net/ipv4/udp.c+1−0
@@ -74,6 +74,7 @@ · 73 unmodified lines
7474
7575 #define pr_fmt(fmt) "UDP: " fmt
7676
77+#include <linux/bpf-cgroup.h>
7778 #include <linux/uaccess.h>
7879 #include <asm/ioctls.h>
7980 #include <linux/memblock.h>
net/ipv6/ip6_fib.c+1−0
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515
1616 #define pr_fmt(fmt) "IPv6: " fmt
1717
18+#include <linux/bpf.h>
1819 #include <linux/errno.h>
1920 #include <linux/types.h>
2021 #include <linux/net.h>
net/ipv6/seg6_local.c+1−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 * eBPF support: Mathieu Xhonneux <m.xhonneux@gmail.com>
88 */
99
10+#include <linux/filter.h>
1011 #include <linux/types.h>
1112 #include <linux/skbuff.h>
1213 #include <linux/net.h>
net/ipv6/udp.c+1−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 * YOSHIFUJI Hideaki @USAGI: convert /proc/net/udp6 to seq_file.
1818 */
1919
20+#include <linux/bpf-cgroup.h>
2021 #include <linux/errno.h>
2122 #include <linux/types.h>
2223 #include <linux/socket.h>
net/iucv/af_iucv.c+1−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #define KMSG_COMPONENT "af_iucv"
1414 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
1515
16+#include <linux/filter.h>
1617 #include <linux/module.h>
1718 #include <linux/netdevice.h>
1819 #include <linux/types.h>
net/kcm/kcmsock.c+1−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 #include <linux/errno.h>
1010 #include <linux/errqueue.h>
1111 #include <linux/file.h>
12+#include <linux/filter.h>
1213 #include <linux/in.h>
1314 #include <linux/kernel.h>
1415 #include <linux/module.h>
net/netfilter/nfnetlink_hook.c+1−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 */
77
88 #include <linux/module.h>
9+#include <linux/kallsyms.h>
910 #include <linux/kernel.h>
1011 #include <linux/types.h>
1112 #include <linux/skbuff.h>
net/netfilter/nft_reject_netdev.c+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 * Copyright (c) 2020 Jose M. Guisado <guigom@riseup.net>
55 */
66
7+#include <linux/etherdevice.h>
78 #include <linux/kernel.h>
89 #include <linux/init.h>
910 #include <linux/module.h>
net/netlink/af_netlink.c+2−0
@@ -20,8 +20,10 @@ · 19 unmodified lines
2020
2121 #include <linux/module.h>
2222
23+#include <linux/bpf.h>
2324 #include <linux/capability.h>
2425 #include <linux/kernel.h>
26+#include <linux/filter.h>
2527 #include <linux/init.h>
2628 #include <linux/signal.h>
2729 #include <linux/sched.h>
net/packet/af_packet.c+1−0
@@ -49,6 +49,7 @@ · 48 unmodified lines
4949 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
5050
5151 #include <linux/ethtool.h>
52+#include <linux/filter.h>
5253 #include <linux/types.h>
5354 #include <linux/mm.h>
5455 #include <linux/capability.h>
net/rose/rose_in.c+1−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 * diagrams as the code is not obvious and probably very easy to break.
1010 */
1111 #include <linux/errno.h>
12+#include <linux/filter.h>
1213 #include <linux/types.h>
1314 #include <linux/socket.h>
1415 #include <linux/in.h>
net/sched/sch_frag.c+1−0
@@ -1,4 +1,5 @@
11 // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
2+#include <linux/if_vlan.h>
23 #include <net/netlink.h>
34 #include <net/sch_generic.h>
45 #include <net/pkt_sched.h>
net/smc/smc_ib.c+2−0
@@ -12,6 +12,8 @@ · 11 unmodified lines
1212 * Author(s): Ursula Braun <ubraun@linux.vnet.ibm.com>
1313 */
1414
15+#include <linux/etherdevice.h>
16+#include <linux/if_vlan.h>
1517 #include <linux/random.h>
1618 #include <linux/workqueue.h>
1719 #include <linux/scatterlist.h>
net/smc/smc_ism.c+1−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 * Copyright IBM Corp. 2018
77 */
88
9+#include <linux/if_vlan.h>
910 #include <linux/spinlock.h>
1011 #include <linux/mutex.h>
1112 #include <linux/slab.h>
net/socket.c+1−0
@@ -52,6 +52,7 @@ · 51 unmodified lines
5252 * Based upon Swansea University Computer Society NET3.039
5353 */
5454
55+#include <linux/bpf-cgroup.h>
5556 #include <linux/ethtool.h>
5657 #include <linux/mm.h>
5758 #include <linux/socket.h>
net/unix/af_unix.c+1−0
@@ -89,6 +89,7 @@ · 88 unmodified lines
8989 #include <linux/socket.h>
9090 #include <linux/un.h>
9191 #include <linux/fcntl.h>
92+#include <linux/filter.h>
9293 #include <linux/termios.h>
9394 #include <linux/sockios.h>
9495 #include <linux/net.h>
net/vmw_vsock/af_vsock.c+1−0
@@ -85,6 +85,7 @@ · 84 unmodified lines
8585 * TCP_LISTEN - listening
8686 */
8787
88+#include <linux/compat.h>
8889 #include <linux/types.h>
8990 #include <linux/bitops.h>
9091 #include <linux/cred.h>
net/xdp/xskmap.c+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 */
55
66 #include <linux/bpf.h>
7+#include <linux/filter.h>
78 #include <linux/capability.h>
89 #include <net/xdp_sock.h>
910 #include <linux/slab.h>
net/xfrm/xfrm_state.c+1−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 *
1515 */
1616
17+#include <linux/compat.h>
1718 #include <linux/workqueue.h>
1819 #include <net/xfrm.h>
1920 #include <linux/pfkeyv2.h>
net/xfrm/xfrm_user.c+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 *
1212 */
1313
14+#include <linux/compat.h>
1415 #include <linux/crypto.h>
1516 #include <linux/module.h>
1617 #include <linux/kernel.h>

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t