* [PATCH] bpf: Fix holes in special_kfunc_list if !CONFIG_NET
@ 2024-12-19 21:41 Thomas Weißschuh
2024-12-20 13:55 ` Jiri Olsa
2024-12-30 23:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Weißschuh @ 2024-12-19 21:41 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa
Cc: bpf, linux-kernel, Thomas Weißschuh, Alexei Starovoitov
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>
---
kernel/bpf/verifier.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index f27274e933e55342dcefa482a9ac75313d0d3469..44616b492f87cf4e1dc354e34d9158f13079dda7 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -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)
---
base-commit: c2ce3bb13ae7f4445a5e8fb12254b2dacefd309c
change-id: 20241219-bpf-fix-special_kfunc_list-cddcf0ba5216
Best regards,
--
Thomas Weißschuh <linux@weissschuh.net>
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] bpf: Fix holes in special_kfunc_list if !CONFIG_NET
2024-12-19 21:41 [PATCH] bpf: Fix holes in special_kfunc_list if !CONFIG_NET Thomas Weißschuh
@ 2024-12-20 13:55 ` Jiri Olsa
2024-12-30 23:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Olsa @ 2024-12-20 13:55 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Alexei Starovoitov, Daniel Borkmann, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, bpf,
linux-kernel
On Thu, Dec 19, 2024 at 10:41:41PM +0100, Thomas Weißschuh wrote:
> 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>
jirka
> ---
> kernel/bpf/verifier.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index f27274e933e55342dcefa482a9ac75313d0d3469..44616b492f87cf4e1dc354e34d9158f13079dda7 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -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)
>
> ---
> base-commit: c2ce3bb13ae7f4445a5e8fb12254b2dacefd309c
> change-id: 20241219-bpf-fix-special_kfunc_list-cddcf0ba5216
>
> Best regards,
> --
> Thomas Weißschuh <linux@weissschuh.net>
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] bpf: Fix holes in special_kfunc_list if !CONFIG_NET
2024-12-19 21:41 [PATCH] bpf: Fix holes in special_kfunc_list if !CONFIG_NET Thomas Weißschuh
2024-12-20 13:55 ` Jiri Olsa
@ 2024-12-30 23:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-12-30 23:00 UTC (permalink / raw)
To: =?utf-8?q?Thomas_Wei=C3=9Fschuh_=3Clinux=40weissschuh=2Enet=3E?=
Cc: ast, daniel, john.fastabend, andrii, martin.lau, eddyz87, song,
yonghong.song, kpsingh, sdf, haoluo, jolsa, bpf, linux-kernel
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:
On Thu, 19 Dec 2024 22:41:41 +0100 you wrote:
> 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>
>
> [...]
Here is the summary with links:
- bpf: Fix holes in special_kfunc_list if !CONFIG_NET
https://git.kernel.org/bpf/bpf-next/c/4a24035964b7
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-12-30 23:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-19 21:41 [PATCH] bpf: Fix holes in special_kfunc_list if !CONFIG_NET Thomas Weißschuh
2024-12-20 13:55 ` Jiri Olsa
2024-12-30 23:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox