Function report |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-28 13:01:59 |
Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:check_cond_jmp_op
Proto:static int check_cond_jmp_op(struct bpf_verifier_env *env, struct bpf_insn *insn, int *insn_idx)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct bpf_verifier_env * | env | |
struct bpf_insn * | insn | |
int * | insn_idx |
6047 | struct bpf_reg_state * dst_reg, * other_branch_regs, * src_reg = NULL |
6048 | opcode = alu/jmp fields ( opcode ) |
6050 | pred = -1 |
6054 | If opcode == BPF_JA || opcode > SLE is signed, '<=' Then |
6060 | If signed immediate constant != 0 Then |
6070 | If is_pointer_value(env, source register ) Then |
6071 | verbose(env, "R%d pointer comparison prohibited\n", source register ) |
6073 | Return -EACCES |
6075 | src_reg = regs[ source register ] |
6076 | Else |
6077 | If source register != BPF_REG_0 Then |
6088 | dst_reg = regs[ dest register ] |
6089 | is_jmp32 = Instruction classes ( opcode ) == jmp mode in word width |
6098 | If pred >= 0 Then |
6099 | err = mark_chain_precision(env, dest register ) |
6100 | If BPF_SRC( opcode ) == BPF_X && Not err Then err = mark_chain_precision(env, source register ) |
6105 | If pred == 1 Then |
6107 | insn_idx += signed offset |
6108 | Return 0 |
6109 | Else if pred == 0 Then |
6113 | Return 0 |
6116 | other_branch = push_stack(env, * insn_idx + signed offset + 1, * insn_idx, false) |
6118 | If Not other_branch Then Return -EFAULT |
6120 | other_branch_regs = regs |
6130 | src_reg = regs[ source register ] |
6158 | Else if Not is_jmp32 && ( opcode == BPF_JEQ || opcode == jump != ) Then reg_combine_min_max( & other_branch_regs[ source register ], & other_branch_regs[ dest register ], src_reg, dst_reg, opcode) |
6165 | Else if Ordering of fields matters. See states_equal() == g doesn't contain a valid pointer Then |
6174 | If Not is_jmp32 && BPF_SRC( opcode ) == BPF_K && signed immediate constant == 0 && ( opcode == BPF_JEQ || opcode == jump != ) && reg_type_may_be_null( Ordering of fields matters. See states_equal() ) Then |
6184 | Else if Not try_match_pkt_pointers(insn, dst_reg, & regs[ source register ], this_branch, other_branch) && is_pointer_value(env, dest register ) Then |
6187 | verbose(env, "R%d pointer comparison prohibited\n", dest register ) |
6189 | Return -EACCES |
6191 | If level & BPF_LOG_LEVEL Then print_verifier_state(env, call stack tracking [curframe]) |
6193 | Return 0 |
Name | Describe |
---|---|
do_check |
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 |