xref: /linux/tools/testing/selftests/bpf/verifier/junk_insn.c (revision 4b132aacb0768ac1e652cf517097ea6f237214b9)
1 {
2 	"junk insn",
3 	.insns = {
4 	BPF_RAW_INSN(0, 0, 0, 0, 0),
5 	BPF_EXIT_INSN(),
6 	},
7 	.errstr = "unknown opcode 00",
8 	.result = REJECT,
9 },
10 {
11 	"junk insn2",
12 	.insns = {
13 	BPF_RAW_INSN(1, 0, 0, 0, 0),
14 	BPF_EXIT_INSN(),
15 	},
16 	.errstr = "BPF_LDX uses reserved fields",
17 	.result = REJECT,
18 },
19 {
20 	"junk insn3",
21 	.insns = {
22 	BPF_RAW_INSN(-1, 0, 0, 0, 0),
23 	BPF_EXIT_INSN(),
24 	},
25 	.errstr = "unknown opcode ff",
26 	.result = REJECT,
27 },
28 {
29 	"junk insn4",
30 	.insns = {
31 	BPF_RAW_INSN(-1, -1, -1, -1, -1),
32 	BPF_EXIT_INSN(),
33 	},
34 	.errstr = "unknown opcode ff",
35 	.result = REJECT,
36 },
37 {
38 	"junk insn5",
39 	.insns = {
40 	BPF_RAW_INSN(0x7f, -1, -1, -1, -1),
41 	BPF_EXIT_INSN(),
42 	},
43 	.errstr = "BPF_ALU uses reserved fields",
44 	.result = REJECT,
45 },
46