WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / bpf / verifier / cgroup_inv_retcode.c
blob6d65fe3e73212d20aac4ebd11a176e4c35997d6e
2 "bpf_exit with invalid return code. test1",
3 .insns = {
4 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1, 0),
5 BPF_EXIT_INSN(),
6 },
7 .errstr = "R0 has value (0x0; 0xffffffff)",
8 .result = REJECT,
9 .prog_type = BPF_PROG_TYPE_CGROUP_SOCK,
12 "bpf_exit with invalid return code. test2",
13 .insns = {
14 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1, 0),
15 BPF_ALU64_IMM(BPF_AND, BPF_REG_0, 1),
16 BPF_EXIT_INSN(),
18 .result = ACCEPT,
19 .prog_type = BPF_PROG_TYPE_CGROUP_SOCK,
22 "bpf_exit with invalid return code. test3",
23 .insns = {
24 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1, 0),
25 BPF_ALU64_IMM(BPF_AND, BPF_REG_0, 3),
26 BPF_EXIT_INSN(),
28 .errstr = "R0 has value (0x0; 0x3)",
29 .result = REJECT,
30 .prog_type = BPF_PROG_TYPE_CGROUP_SOCK,
33 "bpf_exit with invalid return code. test4",
34 .insns = {
35 BPF_MOV64_IMM(BPF_REG_0, 1),
36 BPF_EXIT_INSN(),
38 .result = ACCEPT,
39 .prog_type = BPF_PROG_TYPE_CGROUP_SOCK,
42 "bpf_exit with invalid return code. test5",
43 .insns = {
44 BPF_MOV64_IMM(BPF_REG_0, 2),
45 BPF_EXIT_INSN(),
47 .errstr = "R0 has value (0x2; 0x0)",
48 .result = REJECT,
49 .prog_type = BPF_PROG_TYPE_CGROUP_SOCK,
52 "bpf_exit with invalid return code. test6",
53 .insns = {
54 BPF_MOV64_REG(BPF_REG_0, BPF_REG_1),
55 BPF_EXIT_INSN(),
57 .errstr = "R0 is not a known value (ctx)",
58 .result = REJECT,
59 .prog_type = BPF_PROG_TYPE_CGROUP_SOCK,
62 "bpf_exit with invalid return code. test7",
63 .insns = {
64 BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1, 0),
65 BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1, 4),
66 BPF_ALU64_REG(BPF_MUL, BPF_REG_0, BPF_REG_2),
67 BPF_EXIT_INSN(),
69 .errstr = "R0 has unknown scalar value",
70 .result = REJECT,
71 .prog_type = BPF_PROG_TYPE_CGROUP_SOCK,