* [PATCH] bpf: Conditionally include dynptr copy kfuncs
@ 2025-10-24 15:14 Malin Jonsson
2025-10-24 16:10 ` Mykyta Yatsenko
2025-10-24 16:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Malin Jonsson @ 2025-10-24 15:14 UTC (permalink / raw)
To: ast, daniel, andrii; +Cc: bpf, Malin Jonsson, Yong Gu, Mykyta Yatsenko
Since commit a498ee7576de ("bpf: Implement dynptr copy kfuncs"), if
CONFIG_BPF_EVENTS is not enabled, but BPF_SYSCALL and DEBUG_INFO_BTF are,
the build will break like so:
BTFIDS vmlinux.unstripped
WARN: resolve_btfids: unresolved symbol bpf_probe_read_user_str_dynptr
WARN: resolve_btfids: unresolved symbol bpf_probe_read_user_dynptr
WARN: resolve_btfids: unresolved symbol bpf_probe_read_kernel_str_dynptr
WARN: resolve_btfids: unresolved symbol bpf_probe_read_kernel_dynptr
WARN: resolve_btfids: unresolved symbol bpf_copy_from_user_task_str_dynptr
WARN: resolve_btfids: unresolved symbol bpf_copy_from_user_task_dynptr
WARN: resolve_btfids: unresolved symbol bpf_copy_from_user_str_dynptr
WARN: resolve_btfids: unresolved symbol bpf_copy_from_user_dynptr
make[2]: *** [scripts/Makefile.vmlinux:72: vmlinux.unstripped] Error 255
make[2]: *** Deleting file 'vmlinux.unstripped'
make[1]: *** [/repo/malin/upstream/linux/Makefile:1242: vmlinux] Error 2
make: *** [Makefile:248: __sub-make] Error 2
Guard these symbols with #ifdef CONFIG_BPF_EVENTS to resolve the problem.
Reported-by: Yong Gu <yong.g.gu@ericsson.com>
Acked-by: Mykyta Yatsenko <yatsenko@meta.com>
Signed-off-by: Malin Jonsson <malin.jonsson@est.tech>
---
kernel/bpf/helpers.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
index 8eb117c52817..eb25e70e0bdc 100644
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -4345,6 +4345,7 @@ BTF_ID_FLAGS(func, bpf_iter_kmem_cache_next, KF_ITER_NEXT | KF_RET_NULL | KF_SLE
BTF_ID_FLAGS(func, bpf_iter_kmem_cache_destroy, KF_ITER_DESTROY | KF_SLEEPABLE)
BTF_ID_FLAGS(func, bpf_local_irq_save)
BTF_ID_FLAGS(func, bpf_local_irq_restore)
+#ifdef CONFIG_BPF_EVENTS
BTF_ID_FLAGS(func, bpf_probe_read_user_dynptr)
BTF_ID_FLAGS(func, bpf_probe_read_kernel_dynptr)
BTF_ID_FLAGS(func, bpf_probe_read_user_str_dynptr)
@@ -4353,6 +4354,7 @@ BTF_ID_FLAGS(func, bpf_copy_from_user_dynptr, KF_SLEEPABLE)
BTF_ID_FLAGS(func, bpf_copy_from_user_str_dynptr, KF_SLEEPABLE)
BTF_ID_FLAGS(func, bpf_copy_from_user_task_dynptr, KF_SLEEPABLE | KF_TRUSTED_ARGS)
BTF_ID_FLAGS(func, bpf_copy_from_user_task_str_dynptr, KF_SLEEPABLE | KF_TRUSTED_ARGS)
+#endif
#ifdef CONFIG_DMA_SHARED_BUFFER
BTF_ID_FLAGS(func, bpf_iter_dmabuf_new, KF_ITER_NEW | KF_SLEEPABLE)
BTF_ID_FLAGS(func, bpf_iter_dmabuf_next, KF_ITER_NEXT | KF_RET_NULL | KF_SLEEPABLE)
--
2.51.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] bpf: Conditionally include dynptr copy kfuncs
2025-10-24 15:14 [PATCH] bpf: Conditionally include dynptr copy kfuncs Malin Jonsson
@ 2025-10-24 16:10 ` Mykyta Yatsenko
2025-10-24 16:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Mykyta Yatsenko @ 2025-10-24 16:10 UTC (permalink / raw)
To: Malin Jonsson, ast, daniel, andrii; +Cc: bpf, Yong Gu, Mykyta Yatsenko
On 10/24/25 16:14, Malin Jonsson wrote:
> Since commit a498ee7576de ("bpf: Implement dynptr copy kfuncs"), if
> CONFIG_BPF_EVENTS is not enabled, but BPF_SYSCALL and DEBUG_INFO_BTF are,
> the build will break like so:
>
> BTFIDS vmlinux.unstripped
> WARN: resolve_btfids: unresolved symbol bpf_probe_read_user_str_dynptr
> WARN: resolve_btfids: unresolved symbol bpf_probe_read_user_dynptr
> WARN: resolve_btfids: unresolved symbol bpf_probe_read_kernel_str_dynptr
> WARN: resolve_btfids: unresolved symbol bpf_probe_read_kernel_dynptr
> WARN: resolve_btfids: unresolved symbol bpf_copy_from_user_task_str_dynptr
> WARN: resolve_btfids: unresolved symbol bpf_copy_from_user_task_dynptr
> WARN: resolve_btfids: unresolved symbol bpf_copy_from_user_str_dynptr
> WARN: resolve_btfids: unresolved symbol bpf_copy_from_user_dynptr
> make[2]: *** [scripts/Makefile.vmlinux:72: vmlinux.unstripped] Error 255
> make[2]: *** Deleting file 'vmlinux.unstripped'
> make[1]: *** [/repo/malin/upstream/linux/Makefile:1242: vmlinux] Error 2
> make: *** [Makefile:248: __sub-make] Error 2
>
> Guard these symbols with #ifdef CONFIG_BPF_EVENTS to resolve the problem.
>
> Reported-by: Yong Gu <yong.g.gu@ericsson.com>
> Acked-by: Mykyta Yatsenko <yatsenko@meta.com>
> Signed-off-by: Malin Jonsson <malin.jonsson@est.tech>
> ---
> kernel/bpf/helpers.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
> index 8eb117c52817..eb25e70e0bdc 100644
> --- a/kernel/bpf/helpers.c
> +++ b/kernel/bpf/helpers.c
> @@ -4345,6 +4345,7 @@ BTF_ID_FLAGS(func, bpf_iter_kmem_cache_next, KF_ITER_NEXT | KF_RET_NULL | KF_SLE
> BTF_ID_FLAGS(func, bpf_iter_kmem_cache_destroy, KF_ITER_DESTROY | KF_SLEEPABLE)
> BTF_ID_FLAGS(func, bpf_local_irq_save)
> BTF_ID_FLAGS(func, bpf_local_irq_restore)
> +#ifdef CONFIG_BPF_EVENTS
> BTF_ID_FLAGS(func, bpf_probe_read_user_dynptr)
> BTF_ID_FLAGS(func, bpf_probe_read_kernel_dynptr)
> BTF_ID_FLAGS(func, bpf_probe_read_user_str_dynptr)
> @@ -4353,6 +4354,7 @@ BTF_ID_FLAGS(func, bpf_copy_from_user_dynptr, KF_SLEEPABLE)
> BTF_ID_FLAGS(func, bpf_copy_from_user_str_dynptr, KF_SLEEPABLE)
> BTF_ID_FLAGS(func, bpf_copy_from_user_task_dynptr, KF_SLEEPABLE | KF_TRUSTED_ARGS)
> BTF_ID_FLAGS(func, bpf_copy_from_user_task_str_dynptr, KF_SLEEPABLE | KF_TRUSTED_ARGS)
> +#endif
> #ifdef CONFIG_DMA_SHARED_BUFFER
> BTF_ID_FLAGS(func, bpf_iter_dmabuf_new, KF_ITER_NEW | KF_SLEEPABLE)
> BTF_ID_FLAGS(func, bpf_iter_dmabuf_next, KF_ITER_NEXT | KF_RET_NULL | KF_SLEEPABLE)
It would be great to include
Fixes: a498ee7576de ("bpf: Implement dynptr copy kfuncs")
in the commit message.
Some context for reviewers:
these kfuncs are defined in bpf_trace.c file which is conditionally built:
obj-$(CONFIG_BPF_EVENTS) += bpf_trace.o
We should guard kfuncs in helpers.c as well.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] bpf: Conditionally include dynptr copy kfuncs
2025-10-24 15:14 [PATCH] bpf: Conditionally include dynptr copy kfuncs Malin Jonsson
2025-10-24 16:10 ` Mykyta Yatsenko
@ 2025-10-24 16:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-10-24 16:50 UTC (permalink / raw)
To: Malin Jonsson; +Cc: ast, daniel, andrii, bpf, yong.g.gu, yatsenko
Hello:
This patch was applied to bpf/bpf.git (master)
by Alexei Starovoitov <ast@kernel.org>:
On Fri, 24 Oct 2025 17:14:36 +0200 you wrote:
> Since commit a498ee7576de ("bpf: Implement dynptr copy kfuncs"), if
> CONFIG_BPF_EVENTS is not enabled, but BPF_SYSCALL and DEBUG_INFO_BTF are,
> the build will break like so:
>
> BTFIDS vmlinux.unstripped
> WARN: resolve_btfids: unresolved symbol bpf_probe_read_user_str_dynptr
> WARN: resolve_btfids: unresolved symbol bpf_probe_read_user_dynptr
> WARN: resolve_btfids: unresolved symbol bpf_probe_read_kernel_str_dynptr
> WARN: resolve_btfids: unresolved symbol bpf_probe_read_kernel_dynptr
> WARN: resolve_btfids: unresolved symbol bpf_copy_from_user_task_str_dynptr
> WARN: resolve_btfids: unresolved symbol bpf_copy_from_user_task_dynptr
> WARN: resolve_btfids: unresolved symbol bpf_copy_from_user_str_dynptr
> WARN: resolve_btfids: unresolved symbol bpf_copy_from_user_dynptr
> make[2]: *** [scripts/Makefile.vmlinux:72: vmlinux.unstripped] Error 255
> make[2]: *** Deleting file 'vmlinux.unstripped'
> make[1]: *** [/repo/malin/upstream/linux/Makefile:1242: vmlinux] Error 2
> make: *** [Makefile:248: __sub-make] Error 2
>
> [...]
Here is the summary with links:
- bpf: Conditionally include dynptr copy kfuncs
https://git.kernel.org/bpf/bpf/c/8ce93aabbf75
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:[~2025-10-24 16:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-24 15:14 [PATCH] bpf: Conditionally include dynptr copy kfuncs Malin Jonsson
2025-10-24 16:10 ` Mykyta Yatsenko
2025-10-24 16:50 ` 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