BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/7] bpf: Make KF_TRUSTED_ARGS default
@ 2025-12-24 19:24 Puranjay Mohan
  2025-12-24 19:24 ` [PATCH bpf-next 1/7] bpf: Make KF_TRUSTED_ARGS the default for all kfuncs Puranjay Mohan
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Puranjay Mohan @ 2025-12-24 19:24 UTC (permalink / raw)
  To: bpf
  Cc: Puranjay Mohan, Puranjay Mohan, Alexei Starovoitov,
	Andrii Nakryiko, Daniel Borkmann, Martin KaFai Lau,
	Eduard Zingerman, Kumar Kartikeya Dwivedi, kernel-team

This set makes the verifier assume KF_TRUSTED_ARGS by default for all
kfunc and gets rid of this flag.

This works because:
  1. Context pointers (xdp_md, __sk_buff, etc.) are handled through
  their own KF_ARG_PTR_TO_CTX case label and bypass the trusted check

  2. Struct_ops callback arguments are already marked as PTR_TRUSTED
  during initialization and pass is_trusted_reg()

  3. KF_RCU kfuncs are handled separately via is_kfunc_rcu() checks at
  call sites.

Puranjay Mohan (7):
  bpf: Make KF_TRUSTED_ARGS the default for all kfuncs
  bpf: net: netfilter: Mark kfuncs accurately
  bpf: Remove redundant KF_TRUSTED_ARGS flag from all kfuncs
  selftests: bpf: Update kfunc_param_nullable test for new error message
  selftests: bpf: Update failure message for rbtree_fail
  selftests: bpf: fix test_kfunc_dynptr_param
  selftests: bpf: fix cgroup_hierarchical_stats

 Documentation/bpf/kfuncs.rst                  | 35 +++++++++----------
 fs/bpf_fs_kfuncs.c                            | 13 ++++---
 fs/verity/measure.c                           |  2 +-
 include/linux/btf.h                           |  3 +-
 kernel/bpf/arena.c                            |  6 ++--
 kernel/bpf/cpumask.c                          |  2 +-
 kernel/bpf/helpers.c                          | 20 +++++------
 kernel/bpf/map_iter.c                         |  2 +-
 kernel/bpf/verifier.c                         | 14 ++------
 kernel/sched/ext.c                            |  8 ++---
 mm/bpf_memcontrol.c                           | 10 +++---
 net/core/filter.c                             | 10 +++---
 net/core/xdp.c                                |  2 +-
 net/netfilter/nf_conntrack_bpf.c              | 30 ++++++++--------
 net/netfilter/nf_flow_table_bpf.c             |  2 +-
 net/netfilter/nf_nat_bpf.c                    |  2 +-
 net/sched/bpf_qdisc.c                         | 12 +++----
 .../bpf/progs/cgroup_hierarchical_stats.c     |  6 ++--
 .../testing/selftests/bpf/progs/rbtree_fail.c |  2 +-
 .../bpf/progs/test_kfunc_dynptr_param.c       |  2 +-
 .../bpf/progs/test_kfunc_param_nullable.c     |  2 +-
 .../selftests/bpf/test_kmods/bpf_testmod.c    | 20 +++++------
 22 files changed, 98 insertions(+), 107 deletions(-)


base-commit: f14cdb1367b947d373215e36cfe9c69768dbafc9
-- 
2.47.3


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

end of thread, other threads:[~2025-12-31 16:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-24 19:24 [PATCH bpf-next 0/7] bpf: Make KF_TRUSTED_ARGS default Puranjay Mohan
2025-12-24 19:24 ` [PATCH bpf-next 1/7] bpf: Make KF_TRUSTED_ARGS the default for all kfuncs Puranjay Mohan
2025-12-30 23:49   ` Eduard Zingerman
2025-12-30 23:56     ` Alexei Starovoitov
2025-12-31  0:08     ` Puranjay Mohan
2025-12-31  0:29       ` Eduard Zingerman
2025-12-31 12:34         ` Puranjay Mohan
2025-12-31 16:45           ` Alexei Starovoitov
2025-12-24 19:24 ` [PATCH bpf-next 2/7] bpf: net: netfilter: Mark kfuncs accurately Puranjay Mohan
2025-12-24 19:24 ` [PATCH bpf-next 3/7] bpf: Remove redundant KF_TRUSTED_ARGS flag from all kfuncs Puranjay Mohan
2025-12-24 19:24 ` [PATCH bpf-next 4/7] selftests: bpf: Update kfunc_param_nullable test for new error message Puranjay Mohan
2025-12-24 19:24 ` [PATCH bpf-next 5/7] selftests: bpf: Update failure message for rbtree_fail Puranjay Mohan
2025-12-24 19:24 ` [PATCH bpf-next 6/7] selftests: bpf: fix test_kfunc_dynptr_param Puranjay Mohan
2025-12-31  2:04   ` Alexei Starovoitov
2025-12-24 19:24 ` [PATCH bpf-next 7/7] selftests: bpf: fix cgroup_hierarchical_stats Puranjay Mohan

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