Function report |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-28 12:57:42 |
Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:check_stack_read
Proto:static int check_stack_read(struct bpf_verifier_env *env, struct bpf_func_state *reg_state, int off, int size, int value_regno)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
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 | If allocated_stack <= slot Then |
2095 | reg = spilled_ptr |
2097 | If stype[0] == register spilled into stack Then |
2098 | If size != size of eBPF register in bytes Then |
2100 | verbose_linfo(env, insn_idx, "; ") |
2102 | Return -EACCES |
2104 | If value_regno >= 0 Then |
2105 | mark_reg_unknown(env, regs, value_regno) |
2109 | Return 0 |
2111 | When i < size of eBPF register in bytes cycle |
2112 | If stype[(slot - i) % size of eBPF register in bytes ] != register spilled into stack Then |
2118 | If value_regno >= 0 Then |
2120 | regs[value_regno] = reg |
2128 | Else |
2129 | zeros = 0 |
2132 | If stype[(slot - i) % size of eBPF register in bytes ] == BPF program wrote some data into this slot Then Continue |
2134 | If stype[(slot - i) % size of eBPF register in bytes ] == BPF program wrote constant zero Then |
2135 | zeros++ |
2136 | Continue |
2140 | Return -EACCES |
2143 | If value_regno >= 0 Then |
2148 | __mark_reg_const_zero( & regs[value_regno]) |
2160 | Else |
2162 | mark_reg_unknown(env, regs, value_regno) |
2167 | Return 0 |
Name | Describe |
---|---|
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 && |
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 |