]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/bpf: Add a kernel flag test for LSM bpf hook
authorBlaise Boscaccy <bboscaccy@linux.microsoft.com>
Mon, 10 Mar 2025 22:17:12 +0000 (15:17 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 15 Mar 2025 18:48:58 +0000 (11:48 -0700)
commit7987f1627e6173ecd9f7d532ca9ee8f62112f381
treed96b61d619adcf7c68dba2a82cd4e875603127b8
parent082f1db02c8034fee787ea9809775ea861c50430
selftests/bpf: Add a kernel flag test for LSM bpf hook

This test exercises the kernel flag added to security_bpf by
effectively blocking light-skeletons from loading while allowing
normal skeletons to function as-is. Since this should work with any
arbitrary BPF program, an existing program from LSKELS_EXTRA was
used as a test payload.

Signed-off-by: Blaise Boscaccy <bboscaccy@linux.microsoft.com>
Acked-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20250310221737.821889-3-bboscaccy@linux.microsoft.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/kernel_flag.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_kernel_flag.c [new file with mode: 0644]