BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v1 00/12] Unify subprog argument checks
@ 2026-09-25 21:12 Amery Hung
  2026-09-25 21:12 ` [PATCH bpf-next v1 01/12] bpf: Fix kfunc nullability diagnostics after wide arguments Amery Hung
                   ` (11 more replies)
  0 siblings, 12 replies; 19+ messages in thread
From: Amery Hung @ 2026-09-25 21:12 UTC (permalink / raw)
  To: bpf
  Cc: alexei.starovoitov, andrii, daniel, eddyz87, memxor, ameryhung,
	kernel-team

Hi,

Helper and kfunc calls now validate arguments through check_func_args(),
while subprog calls still duplicate much of the same validation in
btf_check_func_arg_match(). This makes common argument rules and
diagnostics easy to change for one call kind without updating the other.

This series builds a temporary helper-style argument prototype from the
subprog's cached BTF metadata, then moves each supported argument class to
the common checker. The last patch removes the duplicate loop.

The series is organized as follows:

- Patch 1 fixes kfunc nullability diagnostics after wide arguments.
- Patches 2-3 identify subprog calls in common metadata and generate the
  temporary argument prototype.
- Patches 4-9 move scalar, untrusted, context, arena, dynptr, and BTF-ID
  arguments to the common path.
- Patches 10-11 make packet-change tracking common and move memory
  arguments to the common path.
- Patch 12 removes the legacy loop and checks all subprog arguments through
  check_func_args().

This follows the helper/kfunc argument-checking consolidation:
https://lore.kernel.org/bpf/20260911220415.1396439-1-ameryhung@gmail.com/

Amery Hung (12):
  bpf: Fix kfunc nullability diagnostics after wide arguments
  bpf: Identify subprog calls in argument metadata
  bpf: Build argument prototypes for subprog calls
  bpf: Check subprog scalar arguments in the common path
  bpf: Check global subprog untrusted arguments in the common path
  bpf: Check subprog context arguments in the common path
  bpf: Check subprog arena arguments in the common path
  bpf: Check subprog dynptr arguments in the common path
  bpf: Check global subprog BTF-ID arguments in the common path
  bpf: Track packet changes in call metadata
  bpf: Check global subprog memory arguments in the common path
  bpf: Check all subprog arguments in the common path

 include/linux/bpf_verifier.h                  |   4 +-
 kernel/bpf/verifier.c                         | 285 ++++++++----------
 .../selftests/bpf/progs/aggregate_arg_func.c  |   2 +-
 .../testing/selftests/bpf/progs/dynptr_fail.c |  11 +-
 .../selftests/bpf/progs/test_global_func5.c   |   2 +-
 .../bpf/progs/verifier_global_ptr_args.c      |   7 +-
 .../bpf/progs/verifier_global_subprogs.c      |   2 +-
 7 files changed, 136 insertions(+), 177 deletions(-)

-- 
2.52.0

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2026-09-28 17:43 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-25 21:12 [PATCH bpf-next v1 00/12] Unify subprog argument checks Amery Hung
2026-09-25 21:12 ` [PATCH bpf-next v1 01/12] bpf: Fix kfunc nullability diagnostics after wide arguments Amery Hung
2026-09-26  8:48   ` Alexei Starovoitov
2026-09-28 17:42     ` Amery Hung
2026-09-25 21:12 ` [PATCH bpf-next v1 02/12] bpf: Identify subprog calls in argument metadata Amery Hung
2026-09-25 21:12 ` [PATCH bpf-next v1 03/12] bpf: Build argument prototypes for subprog calls Amery Hung
2026-09-25 21:12 ` [PATCH bpf-next v1 04/12] bpf: Check subprog scalar arguments in the common path Amery Hung
2026-09-25 22:01   ` bot+bpf-ci
2026-09-25 21:12 ` [PATCH bpf-next v1 05/12] bpf: Check global subprog untrusted " Amery Hung
2026-09-25 21:12 ` [PATCH bpf-next v1 06/12] bpf: Check subprog context " Amery Hung
2026-09-25 21:12 ` [PATCH bpf-next v1 07/12] bpf: Check subprog arena " Amery Hung
2026-09-25 21:12 ` [PATCH bpf-next v1 08/12] bpf: Check subprog dynptr " Amery Hung
2026-09-25 21:26   ` sashiko-bot
2026-09-25 21:12 ` [PATCH bpf-next v1 09/12] bpf: Check global subprog BTF-ID " Amery Hung
2026-09-25 21:12 ` [PATCH bpf-next v1 10/12] bpf: Track packet changes in call metadata Amery Hung
2026-09-26  8:49   ` Alexei Starovoitov
2026-09-28 17:42     ` Amery Hung
2026-09-25 21:12 ` [PATCH bpf-next v1 11/12] bpf: Check global subprog memory arguments in the common path Amery Hung
2026-09-25 21:12 ` [PATCH bpf-next v1 12/12] bpf: Check all subprog " Amery Hung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox