* [PATCH] bpf: make bpf_session_cookie() reference optional
@ 2026-05-15 9:06 Arnd Bergmann
2026-05-15 9:16 ` sashiko-bot
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Arnd Bergmann @ 2026-05-15 9:06 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Eduard Zingerman, Kumar Kartikeya Dwivedi, Menglong Dong
Cc: Arnd Bergmann, John Fastabend, Martin KaFai Lau, Song Liu,
Yonghong Song, Jiri Olsa, Puranjay Mohan, Mykyta Yatsenko,
Anton Protopopov, bpf, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
Building without CONFIG_BPF_EVENTS produces a build-time
warning:
WARN: resolve_btfids: unresolved symbol bpf_session_is_return
The function is actually defined in kernel/trace/bpf_trace.o,
which is built conditionally based on configuration.
Make the reference to this function conditional as well,
as is already done in the bpf verifier for other functions.
Fixes: 8fe4dc4f6456 ("bpf: change prototype of bpf_session_{cookie,is_return}")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
kernel/bpf/verifier.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 03f9e16c2abe..a5139f45e366 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -10882,7 +10882,11 @@ BTF_ID(func, bpf_task_work_schedule_resume)
BTF_ID(func, bpf_arena_alloc_pages)
BTF_ID(func, bpf_arena_free_pages)
BTF_ID(func, bpf_arena_reserve_pages)
+#ifdef CONFIG_BPF_EVENTS
BTF_ID(func, bpf_session_is_return)
+#else
+BTF_ID_UNUSED
+#endif
BTF_ID(func, bpf_stream_vprintk)
BTF_ID(func, bpf_stream_print_stack)
--
2.39.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] bpf: make bpf_session_cookie() reference optional
2026-05-15 9:06 [PATCH] bpf: make bpf_session_cookie() reference optional Arnd Bergmann
@ 2026-05-15 9:16 ` sashiko-bot
2026-05-15 9:43 ` bot+bpf-ci
2026-05-19 16:18 ` Yonghong Song
2 siblings, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-05-15 9:16 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: bpf
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The commit title incorrectly states 'bpf: make bpf_session_cookie() reference optional', while the patch actually makes the `bpf_session_is_return()` reference optional.
--
commit 955fac0158a2cad097b15c2d40f2d73bdbbf8828
Author: Arnd Bergmann <arnd@arndb.de>
bpf: make bpf_session_cookie() reference optional
This commit fixes a build warning caused by an unresolved btfid symbol
when building without CONFIG_BPF_EVENTS. It wraps the function reference in
the appropriate preprocessor conditionals to match the verifier's behavior
for other conditionally built functions.
> bpf: make bpf_session_cookie() reference optional
This isn't a bug, but the commit subject mentions bpf_session_cookie(),
while the patch and the commit message body actually update the reference
for bpf_session_is_return(). Should the subject be updated to match the
function being modified?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260515090631.284426-1-arnd@kernel.org?part=1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] bpf: make bpf_session_cookie() reference optional
2026-05-15 9:06 [PATCH] bpf: make bpf_session_cookie() reference optional Arnd Bergmann
2026-05-15 9:16 ` sashiko-bot
@ 2026-05-15 9:43 ` bot+bpf-ci
2026-05-19 16:18 ` Yonghong Song
2 siblings, 0 replies; 4+ messages in thread
From: bot+bpf-ci @ 2026-05-15 9:43 UTC (permalink / raw)
To: arnd, ast, daniel, andrii, eddyz87, memxor, menglong8.dong
Cc: arnd, john.fastabend, martin.lau, song, yonghong.song, jolsa,
puranjay, yatsenko, a.s.protopopov, bpf, linux-kernel, ast,
andrii, daniel, martin.lau, eddyz87, yonghong.song, clm,
ihor.solodrai
[-- Attachment #1: Type: text/plain, Size: 1789 bytes --]
> commit 2cc68d16a6fde2cca5c308c947ae835c366fe09c
> Author: Arnd Bergmann <arnd@arndb.de>
> Date: Fri May 15 11:06:15 2026 +0200
>
> bpf: make bpf_session_cookie() reference optional
The commit subject references bpf_session_cookie(), but the patch actually
makes bpf_session_is_return() conditional. Should the subject line be
updated to reflect the correct function name?
Reference: https://lore.kernel.org/bpf/20260515091607.ED08CC2BCB8@smtp.kernel.org/
>
> Building without CONFIG_BPF_EVENTS produces a build-time
> warning:
>
> WARN: resolve_btfids: unresolved symbol bpf_session_is_return
>
> The function is actually defined in kernel/trace/bpf_trace.o,
> which is built conditionally based on configuration.
>
> Make the reference to this function conditional as well,
> as is already done in the bpf verifier for other functions.
>
> Fixes: 8fe4dc4f6456 ("bpf: change prototype of bpf_session_{cookie,is_return}")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index 76a07f09ab64..cec4edc86485 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -11088,7 +11088,11 @@ BTF_ID(func, bpf_task_work_schedule_resume)
> BTF_ID(func, bpf_arena_alloc_pages)
> BTF_ID(func, bpf_arena_free_pages)
> BTF_ID(func, bpf_arena_reserve_pages)
> +#ifdef CONFIG_BPF_EVENTS
> BTF_ID(func, bpf_session_is_return)
> +#else
> +BTF_ID_UNUSED
> +#endif
> BTF_ID(func, bpf_stream_vprintk)
> BTF_ID(func, bpf_stream_print_stack)
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/25910298674
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] bpf: make bpf_session_cookie() reference optional
2026-05-15 9:06 [PATCH] bpf: make bpf_session_cookie() reference optional Arnd Bergmann
2026-05-15 9:16 ` sashiko-bot
2026-05-15 9:43 ` bot+bpf-ci
@ 2026-05-19 16:18 ` Yonghong Song
2 siblings, 0 replies; 4+ messages in thread
From: Yonghong Song @ 2026-05-19 16:18 UTC (permalink / raw)
To: Arnd Bergmann, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Eduard Zingerman, Kumar Kartikeya Dwivedi,
Menglong Dong
Cc: Arnd Bergmann, John Fastabend, Martin KaFai Lau, Song Liu,
Jiri Olsa, Puranjay Mohan, Mykyta Yatsenko, Anton Protopopov, bpf,
linux-kernel
On 5/15/26 2:06 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Building without CONFIG_BPF_EVENTS produces a build-time
> warning:
>
> WARN: resolve_btfids: unresolved symbol bpf_session_is_return
>
> The function is actually defined in kernel/trace/bpf_trace.o,
> which is built conditionally based on configuration.
>
> Make the reference to this function conditional as well,
> as is already done in the bpf verifier for other functions.
>
> Fixes: 8fe4dc4f6456 ("bpf: change prototype of bpf_session_{cookie,is_return}")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
LGTM exception in subject bpf_session_cookie() should be bpf_session_is_return().
Acked-by: Yonghong Song <yonghong.song@linux.dev>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-05-19 16:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15 9:06 [PATCH] bpf: make bpf_session_cookie() reference optional Arnd Bergmann
2026-05-15 9:16 ` sashiko-bot
2026-05-15 9:43 ` bot+bpf-ci
2026-05-19 16:18 ` Yonghong Song
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.