函数逻辑报告 |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-27 14:18:40 |
| Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:look for pseudo eBPF instructions that access map FDs and* replace them with actual map pointers
函数原型:static int replace_map_fd_with_map_ptr(struct bpf_verifier_env *env)
返回类型:int
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| struct bpf_verifier_env * | env |
| 8167 | insn_cnt等于 Number of filter blocks |
| 8175 | 如果Instruction classes ( opcode )恒等于BPF_LDX且BPF BPF_DW 0x18 64-bit ( opcode )不等于BPF_MEM或 signed immediate constant 不等于0的值则 |
| 8181 | 如果Instruction classes ( opcode )恒等于BPF_STX且BPF BPF_DW 0x18 64-bit ( opcode )不等于BPF_MEM且BPF BPF_DW 0x18 64-bit ( opcode )不等于xclusive add 或 signed immediate constant 不等于0的值则 |
| 8188 | 如果 opcode 恒等于BPF_LD按位或BPF_IMM按位或double word (64-bit) 的值则 |
| 8194 | 如果i恒等于insn_cnt减1或 opcode 不等于0或 dest register 不等于0或 source register 不等于0或 signed offset 不等于0则 |
| 8201 | 如果 source register 恒等于0则转到:next_insn |
| 8217 | f等于fdget( signed immediate constant ) |
| 8218 | map等于 error is returned, fd is released.* On success caller should complete fd access with matching fdput() |
| 8219 | 如果是错误则 |
| 8220 | verbose(env, "fd %d is not pointing to valid bpf_map\n", signed immediate constant ) |
| 8222 | 返回:错误 |
| 8226 | 如果err则 |
| 8231 | aux等于array of per-insn state [i] |
| 8232 | 如果 source register 恒等于When BPF ldimm64's insn[0]则 |
| 8234 | 否则 |
| 8235 | off等于 signed immediate constant |
| 8243 | 如果非map_direct_value_addr则 |
| 8246 | 返回:负EINVAL |
| 8249 | err等于map_direct_value_addr(map, & addr, off) |
| 8250 | 如果err则 |
| 8251 | verbose(env, "invalid access to map value pointer, value_size=%u off=%u\n", value_size, off) |
| 8254 | 返回:err |
| 8261 | signed immediate constant 等于addr |
| 8262 | signed immediate constant 等于addr右移32位 |
| 8265 | 以j小于umber of used maps 循环 |
| 8266 | 如果array of map's used by eBPF program [j]恒等于map则 |
| 8283 | bpf_map_inc(map) |
| 8296 | next_insn : |
| 8297 | insn自加 |
| 8298 | i自加 |
| 8299 | 继续下一循环 |
| 8303 | 如果非bpf_opcode_in_insntable( opcode )则 |
| 8313 | 返回:0 |
| 名称 | 描述 |
|---|---|
| bpf_check |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |