From: Paul Chaignon <paul.chaignon@gmail.com>
To: bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Eduard Zingerman <eddyz87@gmail.com>
Subject: [PATCH bpf-next v2 0/3] Avoid warning on bpf_sock_addr padding access
Date: Wed, 17 Sep 2025 10:07:08 +0200 [thread overview]
Message-ID: <cover.1758094761.git.paul.chaignon@gmail.com> (raw)
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
next reply other threads:[~2025-09-17 8:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-17 8:07 Paul Chaignon [this message]
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
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=cover.1758094761.git.paul.chaignon@gmail.com \
--to=paul.chaignon@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=martin.lau@linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.