BPF List
 help / color / mirror / Atom feed
* [PATCH bpf v1 0/2] Add missing size check for BTF-based ctx access
@ 2024-12-12  9:20 Kumar Kartikeya Dwivedi
  2024-12-12  9:20 ` [PATCH bpf v1 1/2] bpf: Check size for BTF-based ctx access of pointer members Kumar Kartikeya Dwivedi
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kumar Kartikeya Dwivedi @ 2024-12-12  9:20 UTC (permalink / raw)
  To: bpf
  Cc: kkd, Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann,
	Martin KaFai Lau, Eduard Zingerman, Robert Morris, kernel-team

This set fixes a issue reported for tracing and struct ops programs
using btf_ctx_access for ctx checks, where loading a pointer argument
from the ctx doesn't enforce a BPF_DW access size check. The original
report is at link [0]. Also add a regression test along with the fix.

  [0]: https://lore.kernel.org/bpf/51338.1732985814@localhost

Kumar Kartikeya Dwivedi (2):
  bpf: Check size for BTF-based ctx access of pointer members
  selftests/bpf: Add test for narrow ctx load for pointer args

 kernel/bpf/btf.c                              |  6 +++
 .../bpf/progs/verifier_btf_ctx_access.c       | 40 ++++++++++++++++++-
 .../selftests/bpf/progs/verifier_d_path.c     |  4 +-
 3 files changed, 46 insertions(+), 4 deletions(-)


base-commit: 7d0d673627e20cfa3b21a829a896ce03b58a4f1c
-- 
2.43.5


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

end of thread, other threads:[~2024-12-12 19:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-12  9:20 [PATCH bpf v1 0/2] Add missing size check for BTF-based ctx access Kumar Kartikeya Dwivedi
2024-12-12  9:20 ` [PATCH bpf v1 1/2] bpf: Check size for BTF-based ctx access of pointer members Kumar Kartikeya Dwivedi
2024-12-12 19:49   ` Eduard Zingerman
2024-12-12  9:20 ` [PATCH bpf v1 2/2] selftests/bpf: Add test for narrow ctx load for pointer args Kumar Kartikeya Dwivedi
2024-12-12 19:50 ` [PATCH bpf v1 0/2] Add missing size check for BTF-based ctx access patchwork-bot+netdevbpf

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