Function report |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-28 13:00:16 |
| Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:sanitize_ptr_alu
Proto:static int sanitize_ptr_alu(struct bpf_verifier_env *env, struct bpf_insn *insn, const struct bpf_reg_state *ptr_reg, struct bpf_reg_state *dst_reg, bool off_is_neg)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct bpf_verifier_env * | env | |
| struct bpf_insn * | insn | |
| const struct bpf_reg_state * | ptr_reg | |
| struct bpf_reg_state * | dst_reg | |
| bool | off_is_neg |
| 4511 | vstate = current verifier state |
| 4513 | ptr_is_dst_reg = ptr_reg == dst_reg |
| 4514 | opcode = alu/jmp fields ( opcode ) |
| 4519 | If can_skip_alu_sanitation(env, insn) Then Return 0 |
| 4526 | If speculative Then Go to do_sim |
| 4529 | alu_state = If off_is_neg Then BPF_ALU_NEG_VALUE Else 0 |
| 4530 | alu_state |= If ptr_is_dst_reg Then Possible states for alu_state member. Else BPF_ALU_SANITIZE_DST |
| 4533 | If retrieve_ptr_limit(ptr_reg, & alu_limit, opcode, off_is_neg) Then Return 0 |
| 4535 | If update_alu_sanitation_state(aux, alu_state, alu_limit) Then Return -EACCES |
| 4537 | do_sim : |
| 4547 | If Not ptr_is_dst_reg Then |
| 4551 | ret = push_stack(env, insn_idx + 1, insn_idx, true) |
| 4552 | If Not ptr_is_dst_reg && ret Then dst_reg = tmp |
| Name | Describe |
|---|---|
| adjust_ptr_min_max_vals | Handles arithmetic on a pointer and a scalar: computes new min/max and var_off.* Caller should also handle BPF_MOV case separately.* If we return -EACCES, caller may want to try again treating pointer as a* scalar |
| 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 |