selftests/bpf: add destructive kfunc test
authorArtem Savkov <asavkov@redhat.com>
Wed, 10 Aug 2022 06:59:05 +0000 (08:59 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 10 Aug 2022 16:22:18 +0000 (09:22 -0700)
commite338945816754a1c362f606b8e2029f2c023e51c
tree64d658b00f4c229d96a974e1dc0b40a0e4203e9f
parent133790596406ce2658f0864eb7eac64987c2b12f
selftests/bpf: add destructive kfunc test

Add a test checking that programs calling destructive kfuncs can only do
so if they have CAP_SYS_BOOT capabilities.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
Link: https://lore.kernel.org/r/20220810065905.475418-4-asavkov@redhat.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
net/bpf/test_run.c
tools/testing/selftests/bpf/prog_tests/kfunc_call.c
tools/testing/selftests/bpf/progs/kfunc_call_destructive.c [new file with mode: 0644]