]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/bpf: Ensure the unsupported struct_ops prog cannot be loaded
authorMartin KaFai Lau <martin.lau@kernel.org>
Mon, 22 Jul 2024 18:30:47 +0000 (11:30 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 29 Jul 2024 20:09:10 +0000 (13:09 -0700)
commit4009c95fede6b783802ad01f264a7a0541f5ea60
tree120a17e784ca02ef0cfdd75aecc71ff839e06be5
parente44b4fc40cb429f6dedc4518a16221115035f654
selftests/bpf: Ensure the unsupported struct_ops prog cannot be loaded

There is an existing "bpf_tcp_ca/unsupp_cong_op" test to ensure
the unsupported tcp-cc "get_info" struct_ops prog cannot be loaded.

This patch adds a new test in the bpf_testmod such that the
unsupported ops test does not depend on other kernel subsystem
where its supporting ops may be changed in the future.

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20240722183049.2254692-4-martin.lau@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h
tools/testing/selftests/bpf/prog_tests/test_struct_ops_module.c
tools/testing/selftests/bpf/progs/unsupported_ops.c [new file with mode: 0644]