函数逻辑报告 |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-27 14:12:37 |
Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:when register 'regno' is passed into function that will read 'access_size'* bytes from that pointer, make sure that it's within stack boundary* and all elements of stack are initialized
函数原型:static int check_stack_boundary(struct bpf_verifier_env *env, int regno, int access_size, bool zero_size_allowed, struct bpf_call_arg_meta *meta)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct bpf_verifier_env * | env | |
int | regno | |
int | access_size | |
bool | zero_size_allowed | |
struct bpf_call_arg_meta * | meta |
3152 | 如果zero_size_allowed且access_size恒等于0且Does this register contain a constant zero? 则返回:0 |
3156 | verbose(env, "R%d type=%s expected=%s\n", regno, string representation of 'enum bpf_reg_type' [ Ordering of fields matters. See states_equal() ], string representation of 'enum bpf_reg_type' [g == frame_pointer + offset ]) |
3159 | 返回:负EACCES |
3164 | err等于__check_stack_boundary(env, regno, min_off, access_size, zero_size_allowed) |
3168 | 否则 |
3174 | 如果非allow_ptr_leaks则 |
3178 | verbose(env, "R%d indirect variable offset stack access prohibited for !root, var_off=%s\n", regno, tn_buf) |
3180 | 返回:负EACCES |
3199 | err等于__check_stack_boundary(env, regno, min_off, access_size, zero_size_allowed) |
3201 | 如果err则 |
3206 | err等于__check_stack_boundary(env, regno, max_off, access_size, zero_size_allowed) |
3208 | 如果err则 |
3221 | 以i小于max_off加access_size循环 |
3226 | 如果allocated_stack小于等于slot则转到:err |
3228 | stype等于slot_type[slot % size of eBPF register in bytes ] |
3229 | 如果stype恒等于 BPF program wrote some data into this slot 则转到:mark |
3231 | 如果stype恒等于 BPF program wrote constant zero 则 |
3234 | 转到:mark |
3241 | 转到:mark |
3244 | err : |
3248 | 否则 |
3255 | 返回:负EACCES |
3256 | mark : |
3264 | 返回:update_stack_depth(env, state, min_off) |
名称 | 描述 |
---|---|
check_helper_mem_access |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |