From: Amery Hung <ameryhung@gmail.com>
To: bpf@vger.kernel.org
Cc: alexei.starovoitov@gmail.com, andrii@kernel.org,
daniel@iogearbox.net, eddyz87@gmail.com, memxor@gmail.com,
ameryhung@gmail.com, kernel-team@meta.com
Subject: [PATCH bpf-next v1 0/4] Unify helper and kfunc call_arg_meta
Date: Thu, 9 Jul 2026 16:02:37 -0700 [thread overview]
Message-ID: <20260709230242.2003459-1-ameryhung@gmail.com> (raw)
Hi all,
I am working toward unifying helper and kfunc handling in the verifier.
Historically, kfunc verification was mostly done separately from helper.
This causes code/logic duplication and may introduce subtle bugs as the
same checks are implemnented differently.
To address this, I plan to unify function call verification, which will
operate on a common function call descriptor bpf_func_proto.
As the first step, this patchset merges bpf_{kfunc_}call_arg_meta of
kfunc and helepr. The structure is used as a scratch pad for different
helper/kfunc verification mechanisms. The previous object tracking
refactor patchset has unified some of them. This patch handles the rest
and finally merge the two different structures.
The next step will be generating bpf_func_proto for kfunc before the
main verification loop and align kfunc and helper argument types.
Then hopefully helper and kfunc can go throguh the same call verification
path.
Amery Hung (4):
bpf: Remove dynptr check in check_stack_range_initialized()
bpf: Factor out raw_mode-related fields in bpf_call_arg_meta
bpf: Unify helper and kfunc allocation-size argument handling
bpf: Unify helper and kfunc call argument meta
include/linux/bpf_verifier.h | 55 ++--
kernel/bpf/cfg.c | 2 +-
kernel/bpf/verifier.c | 253 +++++++-----------
.../selftests/bpf/prog_tests/kfunc_call.c | 2 +-
.../testing/selftests/bpf/progs/dynptr_fail.c | 4 +-
5 files changed, 146 insertions(+), 170 deletions(-)
--
2.52.0
next reply other threads:[~2026-07-09 23:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 23:02 Amery Hung [this message]
2026-07-09 23:02 ` [PATCH bpf-next v1 1/4] bpf: Remove dynptr check in check_stack_range_initialized() Amery Hung
2026-07-09 23:02 ` [PATCH bpf-next v1 2/4] bpf: Factor out raw_mode-related fields in bpf_call_arg_meta Amery Hung
2026-07-09 23:17 ` sashiko-bot
2026-07-09 23:36 ` Amery Hung
2026-07-09 23:02 ` [PATCH bpf-next v1 3/4] bpf: Unify helper and kfunc allocation-size argument handling Amery Hung
2026-07-10 0:02 ` bot+bpf-ci
2026-07-09 23:02 ` [PATCH bpf-next v1 4/4] bpf: Unify helper and kfunc call argument meta Amery Hung
2026-07-09 23:16 ` sashiko-bot
2026-07-09 23:44 ` Amery Hung
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=20260709230242.2003459-1-ameryhung@gmail.com \
--to=ameryhung@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=kernel-team@meta.com \
--cc=memxor@gmail.com \
/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