BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/3] Avoid warning on bpf_sock_addr padding access
@ 2025-09-17  8:07 Paul Chaignon
  2025-09-17  8:08 ` [PATCH bpf-next v2 1/3] bpf: Explicitly check accesses to bpf_sock_addr Paul Chaignon
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Paul Chaignon @ 2025-09-17  8:07 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Eduard Zingerman

This patchset fixes bpf_sock_addr padding access to avoid a kernel
warning and improves our selftests coverage for these ctx padding cases.

Changes in v2:
  - Rebased on top of bpf-next.
  - Added selftests for paddings in bpf_sock and sk_reuseport_md.
  - Simplified sock_addr_is_valid_access's logic, as suggested by Daniel.
  - Removed a tab copied from existing code and spotted by Eduard.

Paul Chaignon (3):
  bpf: Explicitly check accesses to bpf_sock_addr
  selftests/bpf: Move macros to bpf_misc.h
  selftest/bpf: Test accesses to ctx padding

 net/core/filter.c                             | 16 ++++++----
 tools/testing/selftests/bpf/progs/bpf_misc.h  |  4 +++
 .../selftests/bpf/progs/test_cls_redirect.c   |  4 +--
 .../bpf/progs/test_tcp_hdr_options.c          |  5 +--
 .../selftests/bpf/progs/verifier_ctx.c        | 32 +++++++++++++++++--
 .../selftests/bpf/progs/verifier_sock.c       |  4 ---
 6 files changed, 46 insertions(+), 19 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2025-09-17 14:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-17  8:07 [PATCH bpf-next v2 0/3] Avoid warning on bpf_sock_addr padding access Paul Chaignon
2025-09-17  8:08 ` [PATCH bpf-next v2 1/3] bpf: Explicitly check accesses to bpf_sock_addr Paul Chaignon
2025-09-17  8:09 ` [PATCH bpf-next v2 2/3] selftests/bpf: Move macros to bpf_misc.h Paul Chaignon
2025-09-17  8:10 ` [PATCH bpf-next v2 3/3] selftest/bpf: Test accesses to ctx padding Paul Chaignon
2025-09-17 14:20 ` [PATCH bpf-next v2 0/3] Avoid warning on bpf_sock_addr padding 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