函数逻辑报告 |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-27 14:14:16 |
Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:sanitize_ptr_alu
函数原型:static int sanitize_ptr_alu(struct bpf_verifier_env *env, struct bpf_insn *insn, const struct bpf_reg_state *ptr_reg, struct bpf_reg_state *dst_reg, bool off_is_neg)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct bpf_verifier_env * | env | |
struct bpf_insn * | insn | |
const struct bpf_reg_state * | ptr_reg | |
struct bpf_reg_state * | dst_reg | |
bool | off_is_neg |
4511 | vstate等于current verifier state |
4513 | ptr_is_dst_reg等于ptr_reg恒等于dst_reg |
4514 | opcode等于alu/jmp fields ( opcode ) |
4519 | 如果can_skip_alu_sanitation(env, insn)则返回:0 |
4526 | 如果speculative则转到:do_sim |
4529 | alu_state等于如果off_is_neg则BPF_ALU_NEG_VALUE否则0 |
4533 | 如果retrieve_ptr_limit(ptr_reg, & alu_limit, opcode, off_is_neg)则返回:0 |
4535 | 如果update_alu_sanitation_state(aux, alu_state, alu_limit)则返回:负EACCES |
4537 | do_sim : |
4547 | 如果非ptr_is_dst_reg则 |
4551 | ret等于push_stack(env, insn_idx + 1, insn_idx, true) |
4552 | 如果非ptr_is_dst_reg且ret则dst_reg等于tmp |
名称 | 描述 |
---|---|
adjust_ptr_min_max_vals | Handles arithmetic on a pointer and a scalar: computes new min/max and var_off.* Caller should also handle BPF_MOV case separately.* If we return -EACCES, caller may want to try again treating pointer as a* scalar |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |