函数逻辑报告 |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-27 14:19:32 |
| Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:vert load instructions that access fields of a context type into a* sequence of instructions that access fields of the underlying structure:* struct __sk_buff -> struct sk_buff* struct bpf_sock_ops -> struct sock
函数原型:static int convert_ctx_accesses(struct bpf_verifier_env *env)
返回类型:int
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| struct bpf_verifier_env * | env |
| 8749 | delta等于0 |
| 8750 | insn_cnt等于 Number of filter blocks |
| 8757 | 如果gen_prologue或seen_direct_write则 |
| 8777 | 如果bpf_prog_is_dev_bound( Auxiliary fields )则返回:0 |
| 8785 | 如果 opcode 恒等于BPF_LDX按位或BPF_MEM按位或8-bit 的值或 opcode 恒等于BPF_LDX按位或BPF_MEM按位或16-bit 的值或 opcode 恒等于BPF_LDX按位或BPF_MEM按位或32-bit 的值或 opcode 恒等于BPF_LDX按位或BPF_MEM按位或double word (64-bit) 的值则type等于BPF_READ |
| 8790 | 否则如果 opcode 恒等于BPF_STX按位或BPF_MEM按位或8-bit 的值或 opcode 恒等于BPF_STX按位或BPF_MEM按位或16-bit 的值或 opcode 恒等于BPF_STX按位或BPF_MEM按位或32-bit 的值或 opcode 恒等于BPF_STX按位或BPF_MEM按位或double word (64-bit) 的值则type等于BPF_WRITE |
| 8795 | 否则继续下一循环 |
| 8798 | 如果type恒等于BPF_WRITE且 stack slot to be cleared 则 |
| 8800 | struct bpf_insn patch[] = {Memory store, *(uint *) (dst_reg + off16) = imm32 (double word (64-bit) , BPF_REG_FP, stack slot to be cleared , 0), * insn, } |
| 8823 | 继续下一循环 |
| 8835 | 退出 |
| 8838 | 退出 |
| 8841 | 退出 |
| 8847 | opcode 等于BPF_LDX按位或unused opcode to mark special load instruction. Same as BPF_ABS 按位或ld/ldx fields ( opcode ) |
| 8848 | num_exentries自加 |
| 8849 | 继续下一循环 |
| 8850 | 默认 |
| 8851 | 继续下一循环 |
| 8855 | size等于BPF_LDST_BYTES(insn) |
| 8862 | is_narrower_load等于size小于ctx_field_size |
| 8864 | off等于 signed offset |
| 8865 | 如果is_narrower_load则 |
| 8874 | 如果ctx_field_size恒等于4则size_code等于32-bit |
| 8876 | 否则如果ctx_field_size恒等于8则size_code等于double word (64-bit) |
| 8879 | signed offset 等于off按位与size_default减1的差的反 |
| 8883 | target_size等于0 |
| 8884 | cnt等于convert_ctx_access(type, insn, insn_buf, BPF program being verified , & target_size) |
| 8892 | 如果is_narrower_load且size小于target_size则 |
| 8893 | shift等于bpf_ctx_narrow_access_offset(off, size, size_default)乘8 |
| 8895 | 如果ctx_field_size小于等于4则 |
| 8896 | 如果shift则insn_buf[cnt++]等于BPF_ALU32_IMM(BPF_RSH, dest register , shift) |
| 8900 | insn_buf[cnt++]等于BPF_ALU32_IMM(BPF_AND, dest register , (1 << size * 8) - 1) |
| 8902 | 否则 |
| 8903 | 如果shift则insn_buf[cnt++]等于ALU ops on immediates, bpf_add|sub|...: dst_reg += imm32 (BPF_RSH, dest register , shift) |
| 8907 | insn_buf[cnt++]等于ALU ops on immediates, bpf_add|sub|...: dst_reg += imm32 (BPF_AND, dest register , (1ULL << size * 8) - 1) |
| 8923 | 返回:0 |
| 名称 | 描述 |
|---|---|
| bpf_check |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |