Function report |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-28 12:58:53 |
Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: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
Proto: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)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct bpf_verifier_env * | env | |
int | regno | |
int | access_size | |
bool | zero_size_allowed | |
struct bpf_call_arg_meta * | meta |
3152 | If zero_size_allowed && access_size == 0 && Does this register contain a constant zero? Then Return 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 | Return -EACCES |
3162 | If Returns true if @a is a known constant Then |
3164 | err = __check_stack_boundary(env, regno, min_off, access_size, zero_size_allowed) |
3168 | Else |
3174 | If Not allow_ptr_leaks Then |
3178 | verbose(env, "R%d indirect variable offset stack access prohibited for !root, var_off=%s\n", regno, tn_buf) |
3180 | Return -EACCES |
3195 | Return -EACCES |
3199 | err = __check_stack_boundary(env, regno, min_off, access_size, zero_size_allowed) |
3201 | If err Then |
3206 | err = __check_stack_boundary(env, regno, max_off, access_size, zero_size_allowed) |
3208 | If err Then |
3221 | When i < max_off + access_size cycle |
3225 | spi = slot / size of eBPF register in bytes |
3226 | If allocated_stack <= slot Then Go to err |
3228 | stype = slot_type[slot % size of eBPF register in bytes ] |
3229 | If stype == BPF program wrote some data into this slot Then Go to mark |
3231 | If stype == BPF program wrote constant zero Then |
3234 | Go to mark |
3239 | When j < size of eBPF register in bytes cycle slot_type[j] = BPF program wrote some data into this slot |
3241 | Go to mark |
3244 | err : |
3245 | If Returns true if @a is a known constant Then |
3248 | Else |
3255 | Return -EACCES |
3256 | mark : |
3264 | Return update_stack_depth(env, state, min_off) |
Name | Describe |
---|---|
check_helper_mem_access |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |