1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/tools/testing/selftests/bpf/progs/kfunc_call_destructive.c
Artem Savkov e338945816 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>
2022-08-10 09:22:18 -07:00

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";