BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: bot+bpf-ci@kernel.org, memxor@gmail.com, bpf@vger.kernel.org
Cc: ast@kernel.org, andrii@kernel.org, daniel@iogearbox.net,
	emil@etsalapatis.com, 	kkd@meta.com, kernel-team@meta.com,
	martin.lau@kernel.org, yonghong.song@linux.dev, 	clm@meta.com,
	ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next v1 06/14] bpf: Correct kfunc argument diagnostics
Date: Sat, 15 Aug 2026 23:50:06 -0700	[thread overview]
Message-ID: <41af6583fa0b058ec97158a17d24648a746e2994.camel@gmail.com> (raw)
In-Reply-To: <bc71b9e364a0d43c49d26f9547a1e757e8a6a38e1c378a6fbea21aa8835dc31d@mail.kernel.org>

On Sun, 2026-08-16 at 02:45 +0000, bot+bpf-ci@kernel.org wrote:
> > diff --git kernel/bpf/verifier.c kernel/bpf/verifier.c
> > index 7ef324e384f4..da2ec0655b17 100644
> > --- kernel/bpf/verifier.c
> > +++ kernel/bpf/verifier.c
> 
> [ ... ]
> 
> > @@ -12653,12 +12653,12 @@ static int check_kfunc_args(struct bpf_verifier_env *env, struct bpf_call_arg_me
> >  		    !type_may_be_null(kf_arg_type)) {
> >  			const char *expected_type;
> > 
> > -			expected_type = bpf_diag_fmt_btf_type(env, btf, ref_id);
> > +			expected_type = bpf_diag_fmt_btf_type(env, btf, args[i].type);
> >  			verbose(env, "Possibly NULL pointer passed to trusted %s\n",
> >  				reg_arg_name(env, argno));
> >  			bpf_diag_call_arg_fmt(env, insn_idx, argno, func_name,
> >  					      "Add a NULL check and call the kfunc only on the non-NULL path.",
> > -					      "the pointer may be NULL, but this kfunc requires a non-NULL pointer to %s",
> > +					      "the pointer may be NULL, but this kfunc requires a non-NULL value of type %s",
> >  					      expected_type);
> >  			return -EACCES;
> >  		}
> 
> Switching from ref_id to args[i].type renders function pointer
> parameters incorrectly. For kfuncs like bpf_task_work_schedule_signal()
> that take a bpf_task_work_callback_t (which is itself a typedef to a
> function pointer), btf_show_name() walks TYPEDEF -> PTR -> FUNC_PROTO,
> collects the typedef name and adds one level of pointer indirection,
> producing "bpf_task_work_callback_t *" instead of the correct parameter
> type "bpf_task_work_callback_t".
> 
> For kfuncs like bpf_wq_set_callback() that take an unnamed function
> pointer directly (PTR -> FUNC_PROTO), the FUNC_PROTO has no name, so
> btf_show_name() produces the malformed "( *)".

Let's keep this as a follow-up; current patch is fine.

  reply	other threads:[~2026-08-16  6:50 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-16  1:57 [PATCH bpf-next v1 00/14] Follow ups for verifier errors set Kumar Kartikeya Dwivedi
2026-08-16  1:57 ` [PATCH bpf-next v1 01/14] bpf: Correct verifier diagnostic attribution for stack reads Kumar Kartikeya Dwivedi
2026-08-16  6:34   ` Eduard Zingerman
2026-08-16  1:57 ` [PATCH bpf-next v1 02/14] selftests/bpf: Test verifier stack-read diagnostic attribution Kumar Kartikeya Dwivedi
2026-08-16  2:45   ` bot+bpf-ci
2026-08-16  6:35   ` Eduard Zingerman
2026-08-16  1:57 ` [PATCH bpf-next v1 03/14] bpf: Preserve R0 lineage across helper calls Kumar Kartikeya Dwivedi
2026-08-16  2:30   ` bot+bpf-ci
2026-08-16  6:12     ` Eduard Zingerman
2026-08-16  6:36   ` Eduard Zingerman
2026-08-16  1:57 ` [PATCH bpf-next v1 04/14] bpf: Drop dead spill diagnostic condition Kumar Kartikeya Dwivedi
2026-08-16  6:39   ` Eduard Zingerman
2026-08-16  1:57 ` [PATCH bpf-next v1 05/14] bpf: Use canonical stack argument names in diagnostics Kumar Kartikeya Dwivedi
2026-08-16  6:40   ` Eduard Zingerman
2026-08-16  1:57 ` [PATCH bpf-next v1 06/14] bpf: Correct kfunc argument diagnostics Kumar Kartikeya Dwivedi
2026-08-16  2:45   ` bot+bpf-ci
2026-08-16  6:50     ` Eduard Zingerman [this message]
2026-08-16  6:52   ` Eduard Zingerman
2026-08-16  1:57 ` [PATCH bpf-next v1 07/14] selftests/bpf: Test " Kumar Kartikeya Dwivedi
2026-08-16  6:53   ` Eduard Zingerman
2026-08-16  1:57 ` [PATCH bpf-next v1 08/14] bpf: Report non-sleepable kfunc programs accurately Kumar Kartikeya Dwivedi
2026-08-16  2:30   ` bot+bpf-ci
2026-08-16  7:32   ` Eduard Zingerman
2026-08-16  1:57 ` [PATCH bpf-next v1 09/14] selftests/bpf: Test non-sleepable kfunc context Kumar Kartikeya Dwivedi
2026-08-16  2:30   ` bot+bpf-ci
2026-08-16  7:37   ` Eduard Zingerman
2026-08-16  1:57 ` [PATCH bpf-next v1 10/14] bpf: Correct Program Structure diagnostic context Kumar Kartikeya Dwivedi
2026-08-16  2:45   ` bot+bpf-ci
2026-08-16  7:58   ` Eduard Zingerman
2026-08-16  1:57 ` [PATCH bpf-next v1 11/14] bpf: Preserve source attribution without source text Kumar Kartikeya Dwivedi
2026-08-16  8:01   ` Eduard Zingerman
2026-08-16  1:57 ` [PATCH bpf-next v1 12/14] selftests/bpf: Test Program Structure diagnostic context Kumar Kartikeya Dwivedi
2026-08-16  8:06   ` Eduard Zingerman
2026-08-16  1:57 ` [PATCH bpf-next v1 13/14] bpf: Distinguish function references in policy diagnostics Kumar Kartikeya Dwivedi
2026-08-16  8:09   ` Eduard Zingerman
2026-08-16  1:57 ` [PATCH bpf-next v1 14/14] selftests/bpf: Test pseudo-function " Kumar Kartikeya Dwivedi
2026-08-16  2:45   ` bot+bpf-ci

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=41af6583fa0b058ec97158a17d24648a746e2994.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bot+bpf-ci@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=clm@meta.com \
    --cc=daniel@iogearbox.net \
    --cc=emil@etsalapatis.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=kernel-team@meta.com \
    --cc=kkd@meta.com \
    --cc=martin.lau@kernel.org \
    --cc=memxor@gmail.com \
    --cc=yonghong.song@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