Function report |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-28 12:57:36 |
Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:heck_stack_read/write functions track spill/fill of registers,* stack boundary and alignment are checked in check_mem_access()
Proto: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)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
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 | If Not allow_ptr_leaks && slot_type[0] == register spilled into stack && size != size of eBPF register in bytes Then |
1974 | cur = call stack tracking [curframe] |
1975 | If value_regno >= 0 Then reg = regs[value_regno] |
1978 | If reg && size == size of eBPF register in bytes && register_is_const(reg) && Not Does this register contain a constant zero? && allow_ptr_leaks Then |
1980 | If dst_reg != BPF_REG_FP Then |
1987 | err = mark_chain_precision(env, value_regno) |
1992 | Else if reg && is_spillable_regtype( Ordering of fields matters. See states_equal() ) Then |
1994 | If size != size of eBPF register in bytes Then |
1995 | verbose_linfo(env, insn_idx, "; ") |
1997 | Return -EACCES |
2002 | Return -EINVAL |
2005 | If Not allow_ptr_leaks Then |
2006 | bool sanitize = false |
2008 | If slot_type[0] == register spilled into stack && register_is_const( & spilled_ptr) Then sanitize = true |
2011 | When i < size of eBPF register in bytes cycle If slot_type[i] == BPF program wrote some data into this slot Then |
2013 | sanitize = true |
2014 | Break |
2016 | If sanitize Then |
2041 | Else |
2047 | If slot_type[0] == register spilled into stack Then When i < size of eBPF register in bytes cycle |
2059 | If size == size of eBPF register in bytes Then live |= g was written first, screening off later reads |
2063 | If reg && Does this register contain a constant zero? Then |
2065 | err = mark_chain_precision(env, value_regno) |
2076 | 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 |