函数逻辑报告 |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-27 14:11:07 |
Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:heck_stack_read/write functions track spill/fill of registers,* stack boundary and alignment are checked in check_mem_access()
函数原型:static int check_stack_write(struct bpf_verifier_env *env, struct bpf_func_state *state, int off, int size, int value_regno, int insn_idx)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct bpf_verifier_env * | env | |
struct bpf_func_state * | state | unc where register points to |
int | off | |
int | size | |
int | value_regno | |
int | insn_idx |
1956 | slot等于负off减1, spi等于slot除size of eBPF register in bytes |
1957 | dst_reg等于 dest register |
1958 | struct bpf_reg_state * reg = NULL |
1960 | err等于do_check() starts with zero-sized stack in struct bpf_verifier_state to* make it consume minimal amount of memory |
1967 | 如果非allow_ptr_leaks且slot_type[0]恒等于 register spilled into stack 且size不等于size of eBPF register in bytes 则 |
1974 | cur等于 call stack tracking [curframe] |
1975 | 如果value_regno大于等于0则reg等于regs[value_regno] |
1980 | 如果dst_reg不等于BPF_REG_FP则 |
1987 | err等于mark_chain_precision(env, value_regno) |
1994 | 如果size不等于size of eBPF register in bytes 则 |
1995 | verbose_linfo(env, insn_idx, "; ") |
1997 | 返回:负EACCES |
2002 | 返回:负EINVAL |
2005 | 如果非allow_ptr_leaks则 |
2006 | bool sanitize = false |
2008 | 如果slot_type[0]恒等于 register spilled into stack 且register_is_const( & spilled_ptr)则sanitize = true |
2016 | 如果sanitize则 |
2041 | 否则 |
2047 | 如果slot_type[0]恒等于 register spilled into stack 则以i小于size of eBPF register in bytes 循环 |
2065 | err等于mark_chain_precision(env, value_regno) |
2076 | 返回: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 插件可实现:逻辑报告 代码生成和批量转换代码 |