Skip to content

Commit 4a24035

Browse files
t-8chAlexei Starovoitov
authored andcommitted
bpf: Fix holes in special_kfunc_list if !CONFIG_NET
If the function is not available its entry has to be replaced with BTF_ID_UNUSED instead of skipped. Otherwise the list doesn't work correctly. Reported-by: Alexei Starovoitov <[email protected]> Closes: https://lore.kernel.org/lkml/CAADnVQJQpVziHzrPCCpGE5=8uzw2OkxP8gqe1FkJ6_XVVyVbNw@mail.gmail.com/ Fixes: 00a5acd ("bpf: Fix configuration-dependent BTF function references") Signed-off-by: Thomas Weißschuh <[email protected]> Acked-by: Jiri Olsa <[email protected]> Link: https://lore.kernel.org/r/20241219-bpf-fix-special_kfunc_list-v1-1-d9d50dd61505@weissschuh.net Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 34ea973 commit 4a24035

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/bpf/verifier.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11739,6 +11739,9 @@ BTF_ID(func, bpf_rbtree_first)
1173911739
#ifdef CONFIG_NET
1174011740
BTF_ID(func, bpf_dynptr_from_skb)
1174111741
BTF_ID(func, bpf_dynptr_from_xdp)
11742+
#else
11743+
BTF_ID_UNUSED
11744+
BTF_ID_UNUSED
1174211745
#endif
1174311746
BTF_ID(func, bpf_dynptr_slice)
1174411747
BTF_ID(func, bpf_dynptr_slice_rdwr)

0 commit comments

Comments
 (0)