BPF List
 help / color / mirror / Atom feed
From: Mykyta Yatsenko <mykyta.yatsenko5@gmail.com>
To: Malin Jonsson <malin.jonsson@est.tech>,
	ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org
Cc: bpf@vger.kernel.org, Yong Gu <yong.g.gu@ericsson.com>,
	Mykyta Yatsenko <yatsenko@meta.com>
Subject: Re: [PATCH] bpf: Conditionally include dynptr copy kfuncs
Date: Fri, 24 Oct 2025 17:10:16 +0100	[thread overview]
Message-ID: <52d838df-73ba-4bc9-bb9f-f071572d981d@gmail.com> (raw)
In-Reply-To: <20251024151436.139131-1-malin.jonsson@est.tech>

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.


  reply	other threads:[~2025-10-24 16:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-24 15:14 [PATCH] bpf: Conditionally include dynptr copy kfuncs Malin Jonsson
2025-10-24 16:10 ` Mykyta Yatsenko [this message]
2025-10-24 16:50 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52d838df-73ba-4bc9-bb9f-f071572d981d@gmail.com \
    --to=mykyta.yatsenko5@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=malin.jonsson@est.tech \
    --cc=yatsenko@meta.com \
    --cc=yong.g.gu@ericsson.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox