函数逻辑报告 |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-27 14:11:15 |
Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:check_stack_read
函数原型:static int check_stack_read(struct bpf_verifier_env *env, struct bpf_func_state *reg_state, int off, int size, int value_regno)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct bpf_verifier_env * | env | |
struct bpf_func_state * | reg_state | func where register points to |
int | off | |
int | size | |
int | value_regno |
2083 | vstate等于current verifier state |
2084 | state等于 call stack tracking [curframe] |
2085 | slot等于负off减1, spi等于slot除size of eBPF register in bytes |
2089 | 如果allocated_stack小于等于slot则 |
2095 | reg等于spilled_ptr |
2097 | 如果stype[0]恒等于 register spilled into stack 则 |
2098 | 如果size不等于size of eBPF register in bytes 则 |
2100 | verbose_linfo(env, insn_idx, "; ") |
2102 | 返回:负EACCES |
2104 | 如果value_regno大于等于0则 |
2105 | mark_reg_unknown(env, regs, value_regno) |
2109 | 返回:0 |
2111 | 以i小于size of eBPF register in bytes 循环 |
2112 | 如果stype[(slot - i) % size of eBPF register in bytes ]不等于 register spilled into stack 则 |
2118 | 如果value_regno大于等于0则 |
2120 | regs[value_regno]等于reg |
2128 | 否则 |
2129 | zeros等于0 |
2132 | 如果stype[(slot - i) % size of eBPF register in bytes ]恒等于 BPF program wrote some data into this slot 则继续下一循环 |
2134 | 如果stype[(slot - i) % size of eBPF register in bytes ]恒等于 BPF program wrote constant zero 则 |
2135 | zeros自加 |
2136 | 继续下一循环 |
2140 | 返回:负EACCES |
2143 | 如果value_regno大于等于0则 |
2148 | __mark_reg_const_zero( & regs[value_regno]) |
2160 | 否则 |
2162 | mark_reg_unknown(env, regs, value_regno) |
2167 | 返回:0 |
名称 | 描述 |
---|---|
check_mem_access | heck whether memory at (regno + off) is accessible for t = (read | write)* if t==write, value_regno is a register which value is stored into memory* if t==read, value_regno is a register which will receive the value from memory* if t==write && |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |