xref: /linux/tools/testing/selftests/bpf/progs/struct_ops_arena_fail.c (revision 9d19ca5d0e8b4a3f4b2eaa14e86a25f1c93ff35b)
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2026 Meta Platforms, Inc. and affiliates. */
3 
4 #include <vmlinux.h>
5 #include <bpf/bpf_helpers.h>
6 #include "../test_kmods/bpf_testmod.h"
7 
8 char _license[] SEC("license") = "GPL";
9 
10 /* No arena in the program: attaching to test_arena must be rejected. */
11 SEC("struct_ops/test_arena")
12 int test_arena_no_arena(unsigned long long *ctx)
13 {
14 	return 0;
15 }
16 
17 SEC(".struct_ops.link")
18 struct bpf_testmod_ops3 testmod_arena_fail = {
19 	.test_arena = (void *)test_arena_no_arena,
20 };
21