From: sashiko-bot@kernel.org
To: asatsuyu.liu@gmail.com
Cc: bpf@vger.kernel.org
Subject: Re: [RFC PATCH 6.18.y 1/1] bpf: Reject NULL arguments to four kfuncs
Date: Wed, 18 Nov 2026 10:40:04 +0000 [thread overview]
Message-ID: <sashiko-outbox-220728@kernel.org> (raw)
In-Reply-To: <20261118101748.2335815-2-asatsuyu.liu@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] bpf: redundant is_kfunc_arg_ignore() check in check_kfunc_args()
--
commit ddaa1152b113559b77a39d01057a7c747399f22a
Author: Yi Liu <asatsuyu.liu@gmail.com>
bpf: Reject NULL arguments to four kfuncs
This commit marks bpf_copy_from_user_str(), bpf_copy_from_user_task_str(),
bpf_crypto_ctx_create(), and bpf_rbtree_remove() with KF_TRUSTED_ARGS so
the verifier rejects NULL or nullable pointer arguments to them.
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index b89a5d717e422..aac687b81b84c 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -13494,6 +13494,7 @@ static int check_kfunc_args(struct bpf_verifier_env *env, struct bpf_kfunc_call_
> }
>
> if ((is_kfunc_trusted_args(meta) || is_kfunc_rcu(meta)) &&
> + !is_kfunc_arg_ignore(meta->btf, &args[i]) &&
> (register_is_null(reg) || type_may_be_null(reg->type)) &&
> !is_kfunc_arg_nullable(meta->btf, &args[i])) {
> verbose(env, "Possibly NULL pointer passed to trusted arg%d\n", i);
[Severity: Low]
Is this new is_kfunc_arg_ignore() check reachable? check_kfunc_args()
already skips __ign parameters at the start of the argument loop (where btf
is meta->btf):
kernel/bpf/verifier.c:check_kfunc_args() {
...
for (i = 0; i < nargs; i++) {
...
if (is_kfunc_arg_ignore(btf, &args[i]))
continue;
...
}
Because __ign arguments never reach the NULL-pointer check, both this hunk
and the commit message paragraph describing it appear unnecessary.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261118101748.2335815-1-asatsuyu.liu@gmail.com?part=1
next prev parent reply other threads:[~2026-11-18 10:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 10:17 [RFC PATCH 6.18.y 0/1] bpf: reject NULL arguments to four kfuncs asatsuyu.liu
2026-11-18 10:17 ` [RFC PATCH 6.18.y 1/1] bpf: Reject " asatsuyu.liu
2026-11-18 10:40 ` sashiko-bot [this message]
2026-11-18 10:40 ` [RFC PATCH 6.18.y 0/1] bpf: reject " Greg KH
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=sashiko-outbox-220728@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=asatsuyu.liu@gmail.com \
--cc=bpf@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox