]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/bpf: Add BTF sanitize test covering BTF layout
authorAlan Maguire <alan.maguire@oracle.com>
Wed, 8 Apr 2026 16:57:35 +0000 (17:57 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 10 Apr 2026 19:34:36 +0000 (12:34 -0700)
commit0e4dc6fbddb01b2ce0d0b4d67ad5f70e976bedcc
treea1b5aa828eba7f5964aa1d0882d0e6fd0ec60ebc
parent7419fcadd1dcd5efb5771a2725f9a80dc90d9e5a
selftests/bpf: Add BTF sanitize test covering BTF layout

Add test that fakes up a feature cache of supported BPF
features to simulate an older kernel that does not support
BTF layout information.  Ensure that BTF is sanitized correctly
to remove layout info between types and strings, and that all
offsets and lengths are adjusted appropriately.

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Link: https://lore.kernel.org/r/20260408165735.843763-3-alan.maguire@oracle.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/btf_sanitize.c [new file with mode: 0644]