From: sashiko-bot@kernel.org
To: "Kumar Kartikeya Dwivedi" <memxor@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v4 10/13] selftests/bpf: Add struct_ops __arena and __arena__nullable argument tests
Date: Wed, 05 Aug 2026 21:15:42 +0000 [thread overview]
Message-ID: <20260805211543.42F9B1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260805210427.3218326-11-memxor@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing NULL check for the global pointer `st_ops3` and its function pointers in `bpf_testmod_ops3_call_test_arena` and `bpf_testmod_ops3_call_test_arena_nullable` kfuncs.
--
--- Patch [10]: [PATCH bpf-next v4 10/13] selftests/bpf: Add struct_ops __arena and __arena__nullable argument tests ---
commit c92a05fea3ca93b4550591e23b6734b40facb5bc
Author: Tejun Heo <tj@kernel.org>
selftests/bpf: Add struct_ops __arena and __arena__nullable argument tests
Add test_arena and test_arena_nullable members to bpf_testmod_ops3 with
arena-tagged stub arguments and kfuncs that forward a caller-provided
pointer to them.
> diff --git a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
> index b92ac1e5df1d2..64ca43744c593 100644
> --- a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
> +++ b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
[ ... ]
> @@ -418,6 +430,16 @@ __bpf_kfunc void bpf_testmod_ops3_call_test_2(void)
> st_ops3->test_2();
> }
>
> +__bpf_kfunc int bpf_testmod_ops3_call_test_arena(u64 *ptr__arena)
> +{
> + return st_ops3->test_arena(ptr__arena);
[Severity: Medium]
Will this cause a kernel panic if a BPF program calls this kfunc before
the struct_ops is attached, leaving st_ops3 as NULL?
Additionally, if a user provides a struct_ops map that omits the test_arena
callback, could st_ops3->test_arena be NULL, leading to a NULL function
pointer dereference?
> +}
> +
> +__bpf_kfunc int bpf_testmod_ops3_call_test_arena_nullable(u64 *ptr__arena__nullable)
> +{
> + return st_ops3->test_arena_nullable(ptr__arena__nullable);
[Severity: Medium]
Similarly, can st_ops3 or st_ops3->test_arena_nullable be NULL here under the
same conditions, causing a panic?
> +}
> +
> struct bpf_testmod_btf_type_tag_1 {
> int a;
> };
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260805210427.3218326-1-memxor@gmail.com?part=10
next prev parent reply other threads:[~2026-08-05 21:15 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 21:04 [PATCH bpf-next v4 00/13] Add arena argument support to kfuncs and struct_ops Kumar Kartikeya Dwivedi
2026-08-05 21:04 ` [PATCH bpf-next v4 01/13] bpf: Rename 'early' BTF checking as a preparation phase Kumar Kartikeya Dwivedi
2026-08-06 16:29 ` Amery Hung
2026-08-05 21:04 ` [PATCH bpf-next v4 02/13] bpf: Split subprogram and kfunc collection Kumar Kartikeya Dwivedi
2026-08-05 21:49 ` bot+bpf-ci
2026-08-06 16:31 ` Amery Hung
2026-08-05 21:04 ` [PATCH bpf-next v4 03/13] bpf: Collect kfuncs after resolving program resources Kumar Kartikeya Dwivedi
2026-08-06 16:37 ` Amery Hung
2026-08-05 21:04 ` [PATCH bpf-next v4 04/13] bpf: Support __arena and __arena__nullable kfunc argument suffixes Kumar Kartikeya Dwivedi
2026-08-06 17:22 ` Amery Hung
2026-08-06 19:20 ` Kumar Kartikeya Dwivedi
2026-08-06 19:23 ` Kumar Kartikeya Dwivedi
2026-08-06 19:31 ` Amery Hung
2026-08-07 0:51 ` Eduard Zingerman
2026-08-05 21:04 ` [PATCH bpf-next v4 05/13] bpf: Support __arena and __arena__nullable on struct_ops arguments Kumar Kartikeya Dwivedi
2026-08-05 21:18 ` sashiko-bot
2026-08-07 0:51 ` Eduard Zingerman
2026-08-05 21:04 ` [PATCH bpf-next v4 06/13] bpf, x86: JIT __arena kfunc argument rebasing Kumar Kartikeya Dwivedi
2026-08-05 21:04 ` [PATCH bpf-next v4 07/13] bpf, x86: Convert struct_ops arena arguments in the trampoline Kumar Kartikeya Dwivedi
2026-08-07 4:09 ` Eduard Zingerman
2026-08-05 21:04 ` [PATCH bpf-next v4 08/13] selftests/bpf: Add kfunc __arena and __arena__nullable argument tests Kumar Kartikeya Dwivedi
2026-08-07 4:44 ` Eduard Zingerman
2026-08-05 21:04 ` [PATCH bpf-next v4 09/13] selftests/bpf: Add JIT-sequence tests for __arena kfunc arguments Kumar Kartikeya Dwivedi
2026-08-07 4:45 ` Eduard Zingerman
2026-08-05 21:04 ` [PATCH bpf-next v4 10/13] selftests/bpf: Add struct_ops __arena and __arena__nullable argument tests Kumar Kartikeya Dwivedi
2026-08-05 21:15 ` sashiko-bot [this message]
2026-08-05 21:04 ` [PATCH bpf-next v4 11/13] bpf, x86: Fix stack-passed arguments for indirect trampolines Kumar Kartikeya Dwivedi
2026-08-05 21:15 ` sashiko-bot
2026-08-05 21:04 ` [PATCH bpf-next v4 12/13] selftests/bpf: Test stack-passed struct_ops arena arguments Kumar Kartikeya Dwivedi
2026-08-05 21:04 ` [PATCH bpf-next v4 13/13] bpf: Reject tracing progs for struct_ops with arena args Kumar Kartikeya Dwivedi
2026-08-05 22:02 ` bot+bpf-ci
2026-08-07 4:51 ` Eduard Zingerman
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=20260805211543.42F9B1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=memxor@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
/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 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.