Skip to content

Commit

Permalink
bpf: Fix holes in special_kfunc_list if !CONFIG_NET
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
t-8ch authored and Kernel Patches Daemon committed Dec 20, 2024
1 parent a16555e commit 311576f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/bpf/verifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -11739,6 +11739,9 @@ BTF_ID(func, bpf_rbtree_first)
#ifdef CONFIG_NET
BTF_ID(func, bpf_dynptr_from_skb)
BTF_ID(func, bpf_dynptr_from_xdp)
#else
BTF_ID_UNUSED
BTF_ID_UNUSED
#endif
BTF_ID(func, bpf_dynptr_slice)
BTF_ID(func, bpf_dynptr_slice_rdwr)
Expand Down

0 comments on commit 311576f

Please sign in to comment.