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>
14 lines
281 B
C
14 lines
281 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include <vmlinux.h>
|
|
#include <bpf/bpf_helpers.h>
|
|
|
|
extern void bpf_kfunc_call_test_destructive(void) __ksym;
|
|
|
|
SEC("tc")
|
|
int kfunc_destructive_test(void)
|
|
{
|
|
bpf_kfunc_call_test_destructive();
|
|
return 0;
|
|
}
|
|
|
|
char _license[] SEC("license") = "GPL";
|