函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:verify BPF_LD_IMM64 instruction

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

返回类型:int

参数:

类型参数名称
struct bpf_verifier_env *env
struct bpf_insn *insn
6199  aux等于cur_aux(env)
6200  regs等于cur_regs(env)
6204  如果ld/ldx fields ( opcode )不等于double word (64-bit)
6205  verbose(env, "invalid BPF_LD_IMM insn\n")
6206  返回:负EINVAL
6208  如果 signed offset 不等于0则
6209  verbose(env, "BPF_LD_IMM64 uses reserved fields\n")
6210  返回:负EINVAL
6213  err等于check_reg_arg(env, dest register , register is used as destination operand )
6214  如果err则返回:err
6217  如果 source register 恒等于0则
6218  imm等于 signed immediate constant 左移32位按位或 signed immediate constant
6220  Ordering of fields matters. See states_equal() 等于g doesn't contain a valid pointer
6221  Mark the unknown part of a register (variable offset or scalar value) as* known to have the value @imm.
6222  返回:0
6225  map等于array of map's used by eBPF program [ index into used_maps[] ]
6226  mark_reg_known_zero(env, regs, dest register )
6227  valid when type == CONST_PTR_TO_MAP | PTR_TO_MAP_VALUE | * PTR_TO_MAP_VALUE_OR_NULL等于map
6229  如果 source register 恒等于BPF_PSEUDO_MAP_VALUE
6230  Ordering of fields matters. See states_equal() 等于g points to map element value
6231  Fixed part of pointer offset, pointer types only 等于 offset from value base address
6232  如果map_value_has_spin_lock(map)则 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等于used to generate unique reg IDs 先自加
6234  否则如果 source register 恒等于When BPF ldimm64's insn[0]
6235  Ordering of fields matters. See states_equal() 等于g points to struct bpf_map
6236  否则
6237  verbose(env, "bpf verifier is misconfigured\n")
6238  返回:负EINVAL
6241  返回:0
调用者
名称描述
do_check