treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / tools / testing / selftests / bpf / verifier / basic_call.c
bloba8c6ab4c1622f3eda8b22134cafbb79ee1e06fbb
2 "invalid call insn1",
3 .insns = {
4 BPF_RAW_INSN(BPF_JMP | BPF_CALL | BPF_X, 0, 0, 0, 0),
5 BPF_EXIT_INSN(),
6 },
7 .errstr = "unknown opcode 8d",
8 .result = REJECT,
9 },
11 "invalid call insn2",
12 .insns = {
13 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 1, 0),
14 BPF_EXIT_INSN(),
16 .errstr = "BPF_CALL uses reserved",
17 .result = REJECT,
20 "invalid function call",
21 .insns = {
22 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, 1234567),
23 BPF_EXIT_INSN(),
25 .errstr = "invalid func unknown#1234567",
26 .result = REJECT,
29 "invalid argument register",
30 .insns = {
31 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_get_cgroup_classid),
32 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_get_cgroup_classid),
33 BPF_EXIT_INSN(),
35 .errstr = "R1 !read_ok",
36 .result = REJECT,
37 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
40 "non-invalid argument register",
41 .insns = {
42 BPF_ALU64_REG(BPF_MOV, BPF_REG_6, BPF_REG_1),
43 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_get_cgroup_classid),
44 BPF_ALU64_REG(BPF_MOV, BPF_REG_1, BPF_REG_6),
45 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_get_cgroup_classid),
46 BPF_EXIT_INSN(),
48 .result = ACCEPT,
49 .prog_type = BPF_PROG_TYPE_SCHED_CLS,