]> Git Repo - linux.git/blob - tools/testing/selftests/bpf/progs/sock_destroy_prog_fail.c
Linux 6.14-rc3
[linux.git] / tools / testing / selftests / bpf / progs / sock_destroy_prog_fail.c
1 // SPDX-License-Identifier: GPL-2.0
2
3 #include "vmlinux.h"
4 #include <bpf/bpf_tracing.h>
5 #include <bpf/bpf_helpers.h>
6
7 #include "bpf_misc.h"
8
9 char _license[] SEC("license") = "GPL";
10
11 int bpf_sock_destroy(struct sock_common *sk) __ksym;
12
13 SEC("tp_btf/tcp_destroy_sock")
14 __failure __msg("calling kernel function bpf_sock_destroy is not allowed")
15 int BPF_PROG(trace_tcp_destroy_sock, struct sock *sk)
16 {
17         /* should not load */
18         bpf_sock_destroy((struct sock_common *)sk);
19
20         return 0;
21 }
22
This page took 0.03305 seconds and 4 git commands to generate.