treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / tools / testing / selftests / bpf / verifier / cfg.c
blob4eb76ed739ce9ea0375cf23d80d7187cb512f486
2 "unreachable",
3 .insns = {
4 BPF_EXIT_INSN(),
5 BPF_EXIT_INSN(),
6 },
7 .errstr = "unreachable",
8 .result = REJECT,
9 },
11 "unreachable2",
12 .insns = {
13 BPF_JMP_IMM(BPF_JA, 0, 0, 1),
14 BPF_JMP_IMM(BPF_JA, 0, 0, 0),
15 BPF_EXIT_INSN(),
17 .errstr = "unreachable",
18 .result = REJECT,
21 "out of range jump",
22 .insns = {
23 BPF_JMP_IMM(BPF_JA, 0, 0, 1),
24 BPF_EXIT_INSN(),
26 .errstr = "jump out of range",
27 .result = REJECT,
30 "out of range jump2",
31 .insns = {
32 BPF_JMP_IMM(BPF_JA, 0, 0, -2),
33 BPF_EXIT_INSN(),
35 .errstr = "jump out of range",
36 .result = REJECT,
39 "loop (back-edge)",
40 .insns = {
41 BPF_JMP_IMM(BPF_JA, 0, 0, -1),
42 BPF_EXIT_INSN(),
44 .errstr = "unreachable insn 1",
45 .errstr_unpriv = "back-edge",
46 .result = REJECT,
49 "loop2 (back-edge)",
50 .insns = {
51 BPF_MOV64_REG(BPF_REG_1, BPF_REG_0),
52 BPF_MOV64_REG(BPF_REG_2, BPF_REG_0),
53 BPF_MOV64_REG(BPF_REG_3, BPF_REG_0),
54 BPF_JMP_IMM(BPF_JA, 0, 0, -4),
55 BPF_EXIT_INSN(),
57 .errstr = "unreachable insn 4",
58 .errstr_unpriv = "back-edge",
59 .result = REJECT,
62 "conditional loop",
63 .insns = {
64 BPF_MOV64_REG(BPF_REG_0, BPF_REG_1),
65 BPF_MOV64_REG(BPF_REG_2, BPF_REG_0),
66 BPF_MOV64_REG(BPF_REG_3, BPF_REG_0),
67 BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0, -3),
68 BPF_EXIT_INSN(),
70 .errstr = "infinite loop detected",
71 .errstr_unpriv = "back-edge",
72 .result = REJECT,