Function report |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-28 13:01:04 |
Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:heck validity of 32-bit and 64-bit arithmetic operations
Proto:static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct bpf_verifier_env * | env | |
struct bpf_insn * | insn |
5167 | opcode = alu/jmp fields ( opcode ) |
5170 | If opcode == lags for endianness conversion: || opcode == BPF_NEG Then |
5172 | If BPF_SRC( opcode ) != 0 || source register != BPF_REG_0 || signed offset != 0 || signed immediate constant != 0 Then |
5178 | Else |
5179 | If source register != BPF_REG_0 || signed offset != 0 || signed immediate constant != 16 && signed immediate constant != 32 && signed immediate constant != 64 || Instruction classes ( opcode ) == alu mode in double word width Then |
5192 | If is_pointer_value(env, dest register ) Then |
5193 | verbose(env, "R%d pointer arithmetic prohibited\n", dest register ) |
5195 | Return -EACCES |
5203 | Else if opcode == mov reg to reg Then |
5206 | If signed immediate constant != 0 || signed offset != 0 Then |
5215 | Else |
5216 | If source register != BPF_REG_0 || signed offset != 0 Then |
5223 | err = check_reg_arg(env, dest register , DST_OP_NO_MARK) |
5228 | src_reg = regs + source register |
5229 | dst_reg = regs + dest register |
5231 | If Instruction classes ( opcode ) == alu mode in double word width Then |
5238 | Else |
5240 | If is_pointer_value(env, source register ) Then |
5241 | verbose(env, "R%d partial copy of pointer\n", source register ) |
5244 | Return -EACCES |
5245 | Else if Ordering of fields matters. See states_equal() == g doesn't contain a valid pointer Then |
5249 | Else |
5250 | mark_reg_unknown(env, regs, dest register ) |
5255 | Else |
5260 | mark_reg_unknown(env, regs, dest register ) |
5262 | If Instruction classes ( opcode ) == alu mode in double word width Then |
5265 | Else |
5271 | Else if opcode > lags for endianness conversion: Then |
5275 | Else |
5278 | If signed immediate constant != 0 || signed offset != 0 Then |
5286 | Else |
5287 | If source register != BPF_REG_0 || signed offset != 0 Then |
5306 | size = If Instruction classes ( opcode ) == alu mode in double word width Then 64 Else 32 |
5308 | If signed immediate constant < 0 || signed immediate constant >= size Then |
5309 | verbose(env, "invalid shift %d\n", signed immediate constant ) |
5310 | Return -EINVAL |
5315 | err = check_reg_arg(env, dest register , DST_OP_NO_MARK) |
5322 | 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 |