函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Implementation details:* bpf_map_lookup returns PTR_TO_MAP_VALUE_OR_NULL* Two bpf_map_lookups (even with the same key) will have different reg->id

函数原型:static int process_spin_lock(struct bpf_verifier_env *env, int regno, bool is_lock)

返回类型:int

参数:

类型参数名称
struct bpf_verifier_env *env
intregno
boolis_lock
3313  regs等于cur_regs(env), reg等于regs
3314  cur等于current verifier state
3315  is_const等于Returns true if @a is a known constant
3316  map等于 valid when type == CONST_PTR_TO_MAP | PTR_TO_MAP_VALUE | * PTR_TO_MAP_VALUE_OR_NULL
3317  val等于value
3319  如果 Ordering of fields matters. See states_equal() 不等于g points to map element value
3320  verbose(env, "R%d is not a pointer to map_value\n", regno)
3321  返回:负EINVAL
3323  如果非is_const
3324  verbose(env, "R%d doesn't have constant offset. bpf_spin_lock has to be at the constant offset\n", regno)
3327  返回:负EINVAL
3329  如果非btf
3330  verbose(env, "map '%s' has to have BTF in order to use bpf_spin_lock\n", name)
3333  返回:负EINVAL
3335  如果非map_value_has_spin_lock(map)则
3336  如果 >=0 valid offset, <0 error 恒等于负E2BIGverbose(env, "map '%s' has more than one 'struct bpf_spin_lock'\n", name)
3340  否则如果 >=0 valid offset, <0 error 恒等于负ENOENTverbose(env, "map '%s' doesn't have 'struct bpf_spin_lock'\n", name)
3344  否则verbose(env, "map '%s' is not a struct type or bpf_spin_lock is mangled\n", name)
3348  返回:负EINVAL
3350  如果 >=0 valid offset, <0 error 不等于val Fixed part of pointer offset, pointer types only
3351  verbose(env, "off %lld doesn't point to 'struct bpf_spin_lock'\n", val + Fixed part of pointer offset, pointer types only )
3353  返回:负EINVAL
3355  如果is_lock
3356  如果active_spin_lock
3357  verbose(env, "Locking two bpf_spin_locks are not allowed\n")
3359  返回:负EINVAL
3361  active_spin_lock等于 For PTR_TO_PACKET, used to find other pointers with the same variable * offset, so they can share range knowledge. * For PTR_TO_MAP_VALUE_OR_NULL this is used to share which map value we * came from, when one is tested for != NULL. * For PTR_TO_SOCKET thi
3362  否则
3363  如果非active_spin_lock
3364  verbose(env, "bpf_spin_unlock without taking a lock\n")
3365  返回:负EINVAL
3368  verbose(env, "bpf_spin_unlock of different lock\n")
3369  返回:负EINVAL
3371  active_spin_lock等于0
3373  返回:0
调用者
名称描述
check_func_arg