函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:check_reg_sane_offset

函数原型:static bool check_reg_sane_offset(struct bpf_verifier_env *env, const struct bpf_reg_state *reg, enum bpf_reg_type type)

返回类型:bool

参数:

类型参数名称
struct bpf_verifier_env *env
const struct bpf_reg_state *reg
enum bpf_reg_typetype
4404  known等于Returns true if @a is a known constant
4405  val等于value
4406  smin等于 minimum possible (s64)value
4408  如果knownval大于等于Maximum variable offset umax_value permitted when resolving memory accesses.* In practice this is far bigger than any realistic pointer offset; this limit* ensures that umax_value + (int)off + (int)size cannot overflow a u64.val小于等于负Maximum variable offset umax_value permitted when resolving memory accesses.* In practice this is far bigger than any realistic pointer offset; this limit* ensures that umax_value + (int)off + (int)size cannot overflow a u64.的值则
4409  verbose(env, "math between %s pointer and %lld is not allowed\n", string representation of 'enum bpf_reg_type' [type], val)
4411  返回:false
4414  如果 Fixed part of pointer offset, pointer types only 大于等于Maximum variable offset umax_value permitted when resolving memory accesses.* In practice this is far bigger than any realistic pointer offset; this limit* ensures that umax_value + (int)off + (int)size cannot overflow a u64. Fixed part of pointer offset, pointer types only 小于等于负Maximum variable offset umax_value permitted when resolving memory accesses.* In practice this is far bigger than any realistic pointer offset; this limit* ensures that umax_value + (int)off + (int)size cannot overflow a u64.
4415  verbose(env, "%s pointer offset %d is not allowed\n", string representation of 'enum bpf_reg_type' [type], Fixed part of pointer offset, pointer types only )
4417  返回:false
4420  如果smin恒等于S64_MIN
4421  verbose(env, "math between %s pointer and register with unbounded min value is not allowed\n", string representation of 'enum bpf_reg_type' [type])
4423  返回:false
4426  如果smin大于等于Maximum variable offset umax_value permitted when resolving memory accesses.* In practice this is far bigger than any realistic pointer offset; this limit* ensures that umax_value + (int)off + (int)size cannot overflow a u64.smin小于等于负Maximum variable offset umax_value permitted when resolving memory accesses.* In practice this is far bigger than any realistic pointer offset; this limit* ensures that umax_value + (int)off + (int)size cannot overflow a u64.
4427  verbose(env, "value %lld makes %s pointer be out of bounds\n", smin, string representation of 'enum bpf_reg_type' [type])
4429  返回:false
4432  返回:true
调用者
名称描述
adjust_ptr_min_max_valsHandles 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