4 BPF_JMP_IMM(BPF_JA
, 0, 0, 2),
5 BPF_LDX_MEM(BPF_B
, BPF_REG_8
, BPF_REG_9
, 0),
6 BPF_JMP_IMM(BPF_JA
, 0, 0, 2),
7 BPF_MOV64_IMM(BPF_REG_0
, 7),
8 BPF_JMP_IMM(BPF_JGE
, BPF_REG_0
, 10, -4),
17 BPF_MOV64_IMM(BPF_REG_0
, 7),
18 BPF_JMP_IMM(BPF_JGE
, BPF_REG_0
, 0, 1),
19 BPF_JMP_IMM(BPF_JGE
, BPF_REG_0
, 10, 0),
28 BPF_RAW_INSN(BPF_JMP
| BPF_CALL
, 0, 0, 0, BPF_FUNC_get_prandom_u32
),
29 BPF_JMP_IMM(BPF_JSET
, BPF_REG_0
, 1, 4),
30 BPF_JMP_IMM(BPF_JSET
, BPF_REG_0
, 1, 1),
31 BPF_JMP_IMM(BPF_JA
, 0, 0, 2),
32 BPF_MOV64_IMM(BPF_REG_0
, 7),
34 BPF_MOV64_IMM(BPF_REG_0
, 1),
43 BPF_MOV64_IMM(BPF_REG_0
, 7),
44 BPF_JMP_IMM(BPF_JGE
, BPF_REG_0
, 10, 1),
54 BPF_MOV64_IMM(BPF_REG_0
, 7),
55 BPF_JMP_IMM(BPF_JGE
, BPF_REG_0
, 10, 1),
57 BPF_MOV64_IMM(BPF_REG_0
, 12),
66 BPF_MOV64_IMM(BPF_REG_0
, 7),
67 BPF_JMP_IMM(BPF_JGE
, BPF_REG_0
, 8, 1),
69 BPF_JMP_IMM(BPF_JGE
, BPF_REG_0
, 10, 1),
70 BPF_JMP_IMM(BPF_JA
, 0, 0, 1),
71 BPF_MOV64_IMM(BPF_REG_0
, 12),
72 BPF_JMP_IMM(BPF_JA
, 0, 0, -5),
78 "dead code: tail of main + func",
80 BPF_MOV64_IMM(BPF_REG_0
, 7),
81 BPF_JMP_IMM(BPF_JGE
, BPF_REG_0
, 8, 1),
83 BPF_RAW_INSN(BPF_JMP
| BPF_CALL
, 0, 1, 0, 1),
85 BPF_MOV64_IMM(BPF_REG_0
, 12),
88 .errstr_unpriv
= "function calls to other bpf functions are allowed for root only",
89 .result_unpriv
= REJECT
,
94 "dead code: tail of main + two functions",
96 BPF_MOV64_IMM(BPF_REG_0
, 7),
97 BPF_JMP_IMM(BPF_JGE
, BPF_REG_0
, 8, 1),
99 BPF_RAW_INSN(BPF_JMP
| BPF_CALL
, 0, 1, 0, 1),
101 BPF_RAW_INSN(BPF_JMP
| BPF_CALL
, 0, 1, 0, 1),
103 BPF_MOV64_IMM(BPF_REG_0
, 12),
106 .errstr_unpriv
= "function calls to other bpf functions are allowed for root only",
107 .result_unpriv
= REJECT
,
112 "dead code: function in the middle and mid of another func",
114 BPF_MOV64_IMM(BPF_REG_1
, 7),
115 BPF_RAW_INSN(BPF_JMP
| BPF_CALL
, 0, 1, 0, 3),
117 BPF_MOV64_IMM(BPF_REG_0
, 12),
119 BPF_MOV64_IMM(BPF_REG_0
, 7),
120 BPF_JMP_IMM(BPF_JGE
, BPF_REG_1
, 7, 1),
121 BPF_RAW_INSN(BPF_JMP
| BPF_CALL
, 0, 1, 0, -5),
124 .errstr_unpriv
= "function calls to other bpf functions are allowed for root only",
125 .result_unpriv
= REJECT
,
130 "dead code: middle of main before call",
132 BPF_MOV64_IMM(BPF_REG_1
, 2),
133 BPF_JMP_IMM(BPF_JGE
, BPF_REG_1
, 2, 1),
134 BPF_MOV64_IMM(BPF_REG_1
, 5),
135 BPF_RAW_INSN(BPF_JMP
| BPF_CALL
, 0, 1, 0, 1),
137 BPF_MOV64_REG(BPF_REG_0
, BPF_REG_1
),
140 .errstr_unpriv
= "function calls to other bpf functions are allowed for root only",
141 .result_unpriv
= REJECT
,
146 "dead code: start of a function",
148 BPF_MOV64_IMM(BPF_REG_1
, 2),
149 BPF_RAW_INSN(BPF_JMP
| BPF_CALL
, 0, 1, 0, 1),
151 BPF_JMP_IMM(BPF_JA
, 0, 0, 0),
152 BPF_MOV64_REG(BPF_REG_0
, BPF_REG_1
),
155 .errstr_unpriv
= "function calls to other bpf functions are allowed for root only",
156 .result_unpriv
= REJECT
,