staging: rtl8192u: remove redundant assignment to pointer crypt
[linux/fpc-iii.git] / tools / testing / selftests / bpf / verifier / ld_imm64.c
blob3856dba733e93f23922962bdd00bf05e0d720366
2 "test1 ld_imm64",
3 .insns = {
4 BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0, 1),
5 BPF_LD_IMM64(BPF_REG_0, 0),
6 BPF_LD_IMM64(BPF_REG_0, 0),
7 BPF_LD_IMM64(BPF_REG_0, 1),
8 BPF_LD_IMM64(BPF_REG_0, 1),
9 BPF_MOV64_IMM(BPF_REG_0, 2),
10 BPF_EXIT_INSN(),
12 .errstr = "invalid BPF_LD_IMM insn",
13 .errstr_unpriv = "R1 pointer comparison",
14 .result = REJECT,
17 "test2 ld_imm64",
18 .insns = {
19 BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0, 1),
20 BPF_LD_IMM64(BPF_REG_0, 0),
21 BPF_LD_IMM64(BPF_REG_0, 0),
22 BPF_LD_IMM64(BPF_REG_0, 1),
23 BPF_LD_IMM64(BPF_REG_0, 1),
24 BPF_EXIT_INSN(),
26 .errstr = "invalid BPF_LD_IMM insn",
27 .errstr_unpriv = "R1 pointer comparison",
28 .result = REJECT,
31 "test3 ld_imm64",
32 .insns = {
33 BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0, 1),
34 BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, 0, 0, 0, 0),
35 BPF_LD_IMM64(BPF_REG_0, 0),
36 BPF_LD_IMM64(BPF_REG_0, 0),
37 BPF_LD_IMM64(BPF_REG_0, 1),
38 BPF_LD_IMM64(BPF_REG_0, 1),
39 BPF_EXIT_INSN(),
41 .errstr = "invalid bpf_ld_imm64 insn",
42 .result = REJECT,
45 "test4 ld_imm64",
46 .insns = {
47 BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, 0, 0, 0, 0),
48 BPF_EXIT_INSN(),
50 .errstr = "invalid bpf_ld_imm64 insn",
51 .result = REJECT,
54 "test5 ld_imm64",
55 .insns = {
56 BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, 0, 0, 0, 0),
58 .errstr = "invalid bpf_ld_imm64 insn",
59 .result = REJECT,
62 "test6 ld_imm64",
63 .insns = {
64 BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, 0, 0, 0, 0),
65 BPF_RAW_INSN(0, 0, 0, 0, 0),
66 BPF_EXIT_INSN(),
68 .result = ACCEPT,
71 "test7 ld_imm64",
72 .insns = {
73 BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, 0, 0, 0, 1),
74 BPF_RAW_INSN(0, 0, 0, 0, 1),
75 BPF_EXIT_INSN(),
77 .result = ACCEPT,
78 .retval = 1,
81 "test8 ld_imm64",
82 .insns = {
83 BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, 0, 0, 1, 1),
84 BPF_RAW_INSN(0, 0, 0, 0, 1),
85 BPF_EXIT_INSN(),
87 .errstr = "uses reserved fields",
88 .result = REJECT,
91 "test9 ld_imm64",
92 .insns = {
93 BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, 0, 0, 0, 1),
94 BPF_RAW_INSN(0, 0, 0, 1, 1),
95 BPF_EXIT_INSN(),
97 .errstr = "invalid bpf_ld_imm64 insn",
98 .result = REJECT,
101 "test10 ld_imm64",
102 .insns = {
103 BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, 0, 0, 0, 1),
104 BPF_RAW_INSN(0, BPF_REG_1, 0, 0, 1),
105 BPF_EXIT_INSN(),
107 .errstr = "invalid bpf_ld_imm64 insn",
108 .result = REJECT,
111 "test11 ld_imm64",
112 .insns = {
113 BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, 0, 0, 0, 1),
114 BPF_RAW_INSN(0, 0, BPF_REG_1, 0, 1),
115 BPF_EXIT_INSN(),
117 .errstr = "invalid bpf_ld_imm64 insn",
118 .result = REJECT,
121 "test12 ld_imm64",
122 .insns = {
123 BPF_MOV64_IMM(BPF_REG_1, 0),
124 BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, 0, BPF_REG_1, 0, 1),
125 BPF_RAW_INSN(0, 0, 0, 0, 0),
126 BPF_EXIT_INSN(),
128 .errstr = "not pointing to valid bpf_map",
129 .result = REJECT,
132 "test13 ld_imm64",
133 .insns = {
134 BPF_MOV64_IMM(BPF_REG_1, 0),
135 BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, 0, BPF_REG_1, 0, 1),
136 BPF_RAW_INSN(0, 0, BPF_REG_1, 0, 1),
137 BPF_EXIT_INSN(),
139 .errstr = "invalid bpf_ld_imm64 insn",
140 .result = REJECT,
143 "test14 ld_imm64: reject 2nd imm != 0",
144 .insns = {
145 BPF_MOV64_IMM(BPF_REG_0, 0),
146 BPF_RAW_INSN(BPF_LD | BPF_IMM | BPF_DW, BPF_REG_1,
147 BPF_PSEUDO_MAP_FD, 0, 0),
148 BPF_RAW_INSN(0, 0, 0, 0, 0xfefefe),
149 BPF_EXIT_INSN(),
151 .fixup_map_hash_48b = { 1 },
152 .errstr = "unrecognized bpf_ld_imm64 insn",
153 .result = REJECT,