函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\verifier.c Create Date:2022-07-27 14:14:59
Last Modify:2022-05-19 20:02:10 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Handles ALU ops other than BPF_END, BPF_NEG and BPF_MOV: computes new min/max* and var_off.

函数原型:static int adjust_reg_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn)

返回类型:int

参数:

类型参数名称
struct bpf_verifier_env *env
struct bpf_insn *insn
5091  vstate等于current verifier state
5092  state等于 call stack tracking [curframe]
5093  regs等于regs
5094  struct bpf_reg_state * ptr_reg = NULL, off_reg = {0}
5095  opcode等于alu/jmp fields ( opcode )
5098  dst_reg等于regs[ dest register ]
5099  src_reg = NULL
5100  如果 Ordering of fields matters. See states_equal() 不等于g doesn't contain a valid pointer ptr_reg等于dst_reg
5102  如果BPF_SRC( opcode )恒等于BPF_X
5103  src_reg等于regs[ source register ]
5110  如果opcode恒等于BPF_SUBallow_ptr_leaks
5112  返回:0
5114  verbose(env, "R%d pointer %s pointer prohibited\n", dest register , bpf_alu_string[opcode >> 4])
5117  返回:负EACCES
5118  否则
5129  否则如果ptr_reg
5132  如果err则返回:err
5137  否则
5141  Ordering of fields matters. See states_equal() 等于g doesn't contain a valid pointer
5142  Mark the unknown part of a register (variable offset or scalar value) as* known to have the value @imm.
5143  src_reg等于off_reg
5144  如果ptr_reg则返回: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
5150  如果WARN_ON_ONCE(ptr_reg)则
5151  print_verifier_state(env, state)
5152  verbose(env, "verifier internal error: unexpected ptr_reg\n")
5153  返回:负EINVAL
5155  如果WARN_ON(!src_reg)则
5156  print_verifier_state(env, state)
5157  verbose(env, "verifier internal error: no src_reg\n")
5158  返回:负EINVAL
5160  返回:WARNING: This function does calculations on 64-bit values, but the actual* execution may occur on 32-bit values. Therefore, things like bitshifts* need extra checks in the 32-bit case.
调用者
名称描述
check_alu_opheck validity of 32-bit and 64-bit arithmetic operations