BPF List
 help / color / mirror / Atom feed
From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: <chenyuan_fl@163.com>
Cc: <andrii@kernel.org>, <ast@kernel.org>, <bot+bpf-ci@kernel.org>,
	<bpf@vger.kernel.org>, <chenyuan@kylinos.cn>, <clm@meta.com>,
	<daniel@iogearbox.net>, <eddyz87@gmail.com>,
	<ihor.solodrai@linux.dev>, <jolsa@kernel.org>,
	<linux-kernel@vger.kernel.org>, <martin.lau@kernel.org>,
	<martin.lau@linux.dev>, <memxor@gmail.com>, <song@kernel.org>,
	<yonghong.song@linux.dev>
Subject: Re: [PATCH bpf v5 0/2] bpf: Fix kfunc implicit arg injection and add selftest
Date: Mon, 08 Jun 2026 12:58:04 -0700	[thread overview]
Message-ID: <DJ3XMAR8TVS5.R5MDDZH8N1IS@gmail.com> (raw)
In-Reply-To: <20260608142618.3064380-1-chenyuan_fl@163.com>

On Mon Jun 8, 2026 at 7:26 AM PDT, chenyuan_fl wrote:
> From: Yuan Chen <chenyuan@kylinos.cn>
>
> v4: https://lore.kernel.org/bpf/20260602093836.2632714-1-chenyuan_fl@163.com/
>
> v1 made btf_types_are_same() cross-BTF aware by comparing kind, size
> and name.  Alan Maguire pointed out that this would be too permissive
> since two different structs can share the same name and size.
>
> v2 used a name-based classifier (get_kfunc_arg_inject_type).
>
> v3 splits the combined is_kfunc_arg_ignore || is_kfunc_arg_implicit
> check in check_kfunc_args(), so that an implicit argument reaching
> is_kfunc_arg_implicit() without any prior handler is rejected with
> -EFAULT instead of silently skipped (Eduard Zingerman).  This prevents
> the silent fallthrough that occurred when module BTF was inconsistent
> with vmlinux (e.g. pahole 1.30 breaking distilled base dedup).
>
> v4: fix a build error in the selftest.
>
> v5 changes:
> - Patch 1: extend the kfunc allow-list in check_kfunc_args() to cover
>   all kfuncs with implicit args handled in bpf_fixup_kfunc_call():
>   obj_new, percpu_obj_new, obj_drop, percpu_obj_drop,
>   refcount_acquire, list_push, rbtree_add (Eduard Zingerman).
> - Patch 2: simplify the selftest by verifying aux->name in
>   bpf_kfunc_implicit_arg() instead of adding a separate struct_ops
>   test program with inline assembly (Eduard Zingerman).  This is
>   a single-file change exercised by the existing kfunc_implicit_args
>   selftest.

Pls address feedback from Eduard and respin with [PATCH bpf-next v6] subject.

pw-bot: cr


  parent reply	other threads:[~2026-06-08 19:58 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07  8:09 [PATCH] bpf: fix btf_types_are_same for cross-BTF type comparison chenyuan_fl
2026-04-07  8:58 ` Leon Hwang
2026-04-07  9:01 ` bot+bpf-ci
2026-04-07 11:19 ` Alan Maguire
2026-05-15 18:27 ` Ihor Solodrai
2026-06-01  6:46 ` [PATCH bpf v2 0/2] bpf: Fix kfunc implicit arg injection and add selftest chenyuan_fl
2026-06-01  6:46   ` [PATCH bpf v2 1/2] bpf: Fix kfunc implicit arg inject type detection to prevent invalid pointer deref chenyuan_fl
2026-06-01  7:42     ` bot+bpf-ci
2026-06-01 19:32       ` Eduard Zingerman
2026-06-02  8:58         ` [PATCH bpf v3 0/2] bpf: Fix kfunc implicit arg injection and add selftest chenyuan_fl
2026-06-02  8:58           ` [PATCH bpf v3 1/2] bpf: Fix kfunc implicit arg inject type detection to prevent invalid pointer deref chenyuan_fl
2026-06-02  9:23             ` sashiko-bot
2026-06-02  9:44             ` bot+bpf-ci
2026-06-02 18:52             ` Ihor Solodrai
2026-06-04  9:14               ` chenyuan
2026-06-04 10:21                 ` Alan Maguire
2026-06-02  8:58           ` [PATCH bpf v3 2/2] selftests/bpf: Add regression test for kfunc implicit arg injection chenyuan_fl
2026-06-02  9:31             ` sashiko-bot
2026-06-02  9:44             ` bot+bpf-ci
2026-06-02  9:38         ` [PATCH bpf v4 0/2] bpf: Fix kfunc implicit arg injection and add selftest chenyuan_fl
2026-06-02  9:38           ` [PATCH bpf v4 1/2] bpf: Fix kfunc implicit arg inject type detection to prevent invalid pointer deref chenyuan_fl
2026-06-02  9:58             ` sashiko-bot
2026-06-02 10:42             ` bot+bpf-ci
2026-06-05  0:42             ` Eduard Zingerman
2026-06-02  9:38           ` [PATCH bpf v4 2/2] selftests/bpf: Add regression test for kfunc implicit arg injection chenyuan_fl
2026-06-02 10:06             ` sashiko-bot
2026-06-02 10:27             ` bot+bpf-ci
2026-06-02 17:36             ` kernel test robot
2026-06-02 18:37             ` kernel test robot
2026-06-05  1:29             ` Eduard Zingerman
2026-06-08 14:26           ` [PATCH bpf v5 0/2] bpf: Fix kfunc implicit arg injection and add selftest chenyuan_fl
2026-06-08 14:26             ` [PATCH bpf v5 1/2] bpf: Fix kfunc implicit arg inject type detection to prevent invalid pointer deref chenyuan_fl
2026-06-08 14:47               ` sashiko-bot
2026-06-08 14:52               ` bot+bpf-ci
2026-06-08 17:28               ` Eduard Zingerman
2026-06-08 14:26             ` [PATCH bpf v5 2/2] selftests/bpf: strengthen bpf_kfunc_implicit_arg to verify aux injection chenyuan_fl
2026-06-08 14:53               ` sashiko-bot
2026-06-08 17:34               ` Eduard Zingerman
2026-06-08 19:58             ` Alexei Starovoitov [this message]
2026-06-01 17:12     ` [PATCH bpf v2 1/2] bpf: Fix kfunc implicit arg inject type detection to prevent invalid pointer deref Yonghong Song
2026-06-01 21:36     ` Eduard Zingerman
2026-06-01  6:46   ` [PATCH bpf v2 2/2] selftests/bpf: Add regression test for kfunc implicit arg injection with stale register chenyuan_fl
2026-06-01  7:08     ` sashiko-bot
2026-06-01 17:17     ` Yonghong Song

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=DJ3XMAR8TVS5.R5MDDZH8N1IS@gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bot+bpf-ci@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=chenyuan@kylinos.cn \
    --cc=chenyuan_fl@163.com \
    --cc=clm@meta.com \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=song@kernel.org \
    --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