Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <alexei.starovoitov@gmail.com>
Closes: https://lore.kernel.org/lkml/CAADnVQJQpVziHzrPCCpGE5=8uzw2OkxP8gqe1FkJ6_XVVyVbNw@mail.gmail.com/
Fixes: 00a5acdbf398 ("bpf: Fix configuration-dependent BTF function references")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20241219-bpf-fix-special_kfunc_list-v1-1-d9d50dd61505@weissschuh.net
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Thomas Weißschuh and committed by
Alexei Starovoitov
4a240359 34ea973d

+3
+3
kernel/bpf/verifier.c
··· 11739 11739 #ifdef CONFIG_NET 11740 11740 BTF_ID(func, bpf_dynptr_from_skb) 11741 11741 BTF_ID(func, bpf_dynptr_from_xdp) 11742 + #else 11743 + BTF_ID_UNUSED 11744 + BTF_ID_UNUSED 11742 11745 #endif 11743 11746 BTF_ID(func, bpf_dynptr_slice) 11744 11747 BTF_ID(func, bpf_dynptr_slice_rdwr)