Lines Matching refs:ebpf

23 use crate::{ebpf, Error, ErrorKind};
31 if prog.len() % ebpf::INSN_SIZE != 0 { in check_prog_len()
34 ebpf::INSN_SIZE in check_prog_len()
37 if prog.len() > ebpf::PROG_MAX_SIZE { in check_prog_len()
40 ebpf::PROG_MAX_INSNS, in check_prog_len()
41 prog.len() / ebpf::INSN_SIZE in check_prog_len()
48 let last_opc = ebpf::get_insn(prog, (prog.len() / ebpf::INSN_SIZE) - 1).opc; in check_prog_len()
49 if last_opc & ebpf::BPF_CLS_MASK != ebpf::BPF_JMP { in check_prog_len()
56 fn check_imm_endian(insn: &ebpf::Insn, insn_ptr: usize) -> Result<(), Error> { in check_imm_endian()
68 let next_insn = ebpf::get_insn(prog, insn_ptr + 1); in check_load_dw()
77 let insn = ebpf::get_insn(prog, insn_ptr); in check_jmp_offset()
83 if dst_insn_ptr < 0 || dst_insn_ptr as usize >= (prog.len() / ebpf::INSN_SIZE) { in check_jmp_offset()
89 let dst_insn = ebpf::get_insn(prog, dst_insn_ptr as usize); in check_jmp_offset()
99 fn check_registers(insn: &ebpf::Insn, store: bool, insn_ptr: usize) -> Result<(), Error> { in check_registers()
117 while insn_ptr * ebpf::INSN_SIZE < prog.len() { in check()
118 let insn = ebpf::get_insn(prog, insn_ptr); in check()
123 ebpf::LD_ABS_B => {} in check()
124 ebpf::LD_ABS_H => {} in check()
125 ebpf::LD_ABS_W => {} in check()
126 ebpf::LD_ABS_DW => {} in check()
127 ebpf::LD_IND_B => {} in check()
128 ebpf::LD_IND_H => {} in check()
129 ebpf::LD_IND_W => {} in check()
130 ebpf::LD_IND_DW => {} in check()
132 ebpf::LD_DW_IMM => { in check()
139 ebpf::LD_B_REG => {} in check()
140 ebpf::LD_H_REG => {} in check()
141 ebpf::LD_W_REG => {} in check()
142 ebpf::LD_DW_REG => {} in check()
145 ebpf::ST_B_IMM => store = true, in check()
146 ebpf::ST_H_IMM => store = true, in check()
147 ebpf::ST_W_IMM => store = true, in check()
148 ebpf::ST_DW_IMM => store = true, in check()
151 ebpf::ST_B_REG => store = true, in check()
152 ebpf::ST_H_REG => store = true, in check()
153 ebpf::ST_W_REG => store = true, in check()
154 ebpf::ST_DW_REG => store = true, in check()
155 ebpf::ST_W_XADD => { in check()
158 ebpf::ST_DW_XADD => { in check()
163 ebpf::ADD32_IMM => {} in check()
164 ebpf::ADD32_REG => {} in check()
165 ebpf::SUB32_IMM => {} in check()
166 ebpf::SUB32_REG => {} in check()
167 ebpf::MUL32_IMM => {} in check()
168 ebpf::MUL32_REG => {} in check()
169 ebpf::DIV32_IMM => {} in check()
170 ebpf::DIV32_REG => {} in check()
171 ebpf::OR32_IMM => {} in check()
172 ebpf::OR32_REG => {} in check()
173 ebpf::AND32_IMM => {} in check()
174 ebpf::AND32_REG => {} in check()
175 ebpf::LSH32_IMM => {} in check()
176 ebpf::LSH32_REG => {} in check()
177 ebpf::RSH32_IMM => {} in check()
178 ebpf::RSH32_REG => {} in check()
179 ebpf::NEG32 => {} in check()
180 ebpf::MOD32_IMM => {} in check()
181 ebpf::MOD32_REG => {} in check()
182 ebpf::XOR32_IMM => {} in check()
183 ebpf::XOR32_REG => {} in check()
184 ebpf::MOV32_IMM => {} in check()
185 ebpf::MOV32_REG => {} in check()
186 ebpf::ARSH32_IMM => {} in check()
187 ebpf::ARSH32_REG => {} in check()
188 ebpf::LE => { in check()
191 ebpf::BE => { in check()
196 ebpf::ADD64_IMM => {} in check()
197 ebpf::ADD64_REG => {} in check()
198 ebpf::SUB64_IMM => {} in check()
199 ebpf::SUB64_REG => {} in check()
200 ebpf::MUL64_IMM => {} in check()
201 ebpf::MUL64_REG => {} in check()
202 ebpf::DIV64_IMM => {} in check()
203 ebpf::DIV64_REG => {} in check()
204 ebpf::OR64_IMM => {} in check()
205 ebpf::OR64_REG => {} in check()
206 ebpf::AND64_IMM => {} in check()
207 ebpf::AND64_REG => {} in check()
208 ebpf::LSH64_IMM => {} in check()
209 ebpf::LSH64_REG => {} in check()
210 ebpf::RSH64_IMM => {} in check()
211 ebpf::RSH64_REG => {} in check()
212 ebpf::NEG64 => {} in check()
213 ebpf::MOD64_IMM => {} in check()
214 ebpf::MOD64_REG => {} in check()
215 ebpf::XOR64_IMM => {} in check()
216 ebpf::XOR64_REG => {} in check()
217 ebpf::MOV64_IMM => {} in check()
218 ebpf::MOV64_REG => {} in check()
219 ebpf::ARSH64_IMM => {} in check()
220 ebpf::ARSH64_REG => {} in check()
223 ebpf::JA => { in check()
226 ebpf::JEQ_IMM => { in check()
229 ebpf::JEQ_REG => { in check()
232 ebpf::JGT_IMM => { in check()
235 ebpf::JGT_REG => { in check()
238 ebpf::JGE_IMM => { in check()
241 ebpf::JGE_REG => { in check()
244 ebpf::JLT_IMM => { in check()
247 ebpf::JLT_REG => { in check()
250 ebpf::JLE_IMM => { in check()
253 ebpf::JLE_REG => { in check()
256 ebpf::JSET_IMM => { in check()
259 ebpf::JSET_REG => { in check()
262 ebpf::JNE_IMM => { in check()
265 ebpf::JNE_REG => { in check()
268 ebpf::JSGT_IMM => { in check()
271 ebpf::JSGT_REG => { in check()
274 ebpf::JSGE_IMM => { in check()
277 ebpf::JSGE_REG => { in check()
280 ebpf::JSLT_IMM => { in check()
283 ebpf::JSLT_REG => { in check()
286 ebpf::JSLE_IMM => { in check()
289 ebpf::JSLE_REG => { in check()
294 ebpf::JEQ_IMM32 => { in check()
297 ebpf::JEQ_REG32 => { in check()
300 ebpf::JGT_IMM32 => { in check()
303 ebpf::JGT_REG32 => { in check()
306 ebpf::JGE_IMM32 => { in check()
309 ebpf::JGE_REG32 => { in check()
312 ebpf::JLT_IMM32 => { in check()
315 ebpf::JLT_REG32 => { in check()
318 ebpf::JLE_IMM32 => { in check()
321 ebpf::JLE_REG32 => { in check()
324 ebpf::JSET_IMM32 => { in check()
327 ebpf::JSET_REG32 => { in check()
330 ebpf::JNE_IMM32 => { in check()
333 ebpf::JNE_REG32 => { in check()
336 ebpf::JSGT_IMM32 => { in check()
339 ebpf::JSGT_REG32 => { in check()
342 ebpf::JSGE_IMM32 => { in check()
345 ebpf::JSGE_REG32 => { in check()
348 ebpf::JSLT_IMM32 => { in check()
351 ebpf::JSLT_REG32 => { in check()
354 ebpf::JSLE_IMM32 => { in check()
357 ebpf::JSLE_REG32 => { in check()
361 ebpf::CALL => {} in check()
362 ebpf::TAIL_CALL => { in check()
365 ebpf::EXIT => {} in check()
381 if insn_ptr != prog.len() / ebpf::INSN_SIZE { in check()