函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:check_reg_arg

函数原型:static int check_reg_arg(struct bpf_verifier_env *env, u32 regno, enum reg_arg_type t)

返回类型:int

参数:

类型参数名称
struct bpf_verifier_env *env
u32regno
enum reg_arg_typet
1428  vstate等于current verifier state
1429  state等于 call stack tracking [curframe]
1430  insn等于insnsiinsn_idx
1431  regs等于regs
1434  如果regno大于等于BPF has 10 general purpose 64-bit registers and stack frame.
1435  verbose(env, "R%d is invalid\n", regno)
1436  返回:负EINVAL
1439  reg等于regs[regno]
1440  rw64等于This function is supposed to be used by the following 32-bit optimization* code only. It returns TRUE if the source or destination register operates* on 64-bit, otherwise return FALSE.
1441  如果t恒等于 register is used as source operand
1444  verbose(env, "R%d !read_ok\n", regno)
1445  返回:负EACCES
1448  如果regno恒等于BPF_REG_FP则返回:0
1451  如果rw64mark_insn_zext(env, reg)
1454  返回:Parentage chain of this register (or stack slot) should take care of all* issues like callee-saved registers, stack slot allocation time, etc.
1456  否则
1458  如果regno恒等于BPF_REG_FP
1459  verbose(env, "frame pointer is read only\n")
1460  返回:负EACCES
1462  live或等于g was written first, screening off later reads
1463  Tracks subreg definition. The stored value is the insn_idx of the * writing insn. This is safe because subreg_def is used before any insn * patching which only happens after main verification finished.等于如果rw64DEF_NOT_SUBREG否则insn_idx加1
1464  如果t恒等于 register is used as destination operand mark_reg_unknown(env, regs, regno)
1467  返回:0
调用者
名称描述
check_xadd
check_func_arg
check_func_call
check_helper_call
check_alu_opheck validity of 32-bit and 64-bit arithmetic operations
check_cond_jmp_op
check_ld_immverify BPF_LD_IMM64 instruction
check_ld_absverify safety of LD_ABS|LD_IND instructions:* - they can only appear in the programs where ctx == skb* - since they are wrappers of function calls, they scratch R1-R5 registers,* preserve R6-R9, and store return value into R0* Implicit input:* ctx == skb
do_check