selftests/bpf: Test accesses to ctx padding
authorPaul Chaignon <paul.chaignon@gmail.com>
Wed, 17 Sep 2025 08:10:53 +0000 (10:10 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 17 Sep 2025 14:15:57 +0000 (16:15 +0200)
commit180a46bc1a1c585f5187df7bccdb522556f4ecd8
tree9801053a2b5cea8238173428a107d7a53f16ea7f
parent7c60f6e488b7aba224ebe396b04ad54b8e31e168
selftests/bpf: Test accesses to ctx padding

This patch adds tests covering the various paddings in ctx structures.
In case of sk_lookup BPF programs, the behavior is a bit different
because accesses to the padding are explicitly allowed. Other cases
result in a clear reject from the verifier.

Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/3dc5f025e350aeb2bb1c257b87c577518e574aeb.1758094761.git.paul.chaignon@gmail.com
tools/testing/selftests/bpf/progs/verifier_ctx.c