函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:init_reg_state

函数原型:static void init_reg_state(struct bpf_verifier_env *env, struct bpf_func_state *state)

返回类型:void

参数:

类型参数名称
struct bpf_verifier_env *env
struct bpf_func_state *state
1111  regs等于regs
1114 i小于BPF has 10 general purpose 64-bit registers and stack frame. 循环
1115  mark_reg_not_init(env, regs, i)
1116  live等于g hasn't been read or written this branch
1117  parentage chain for liveness checking = NULL
1118  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.等于DEF_NOT_SUBREG
1122  Ordering of fields matters. See states_equal() 等于g == frame_pointer + offset
1123  mark_reg_known_zero(env, regs, BPF_REG_FP)
1124  Inside the callee two registers can be both PTR_TO_STACK like * R1=fp-8 and R2=fp-8, but one of them points to this function stack * while another to the caller's stack. To differentiate them 'frameno' * is used which is an index in bpf_verifier_state->fr等于stack frame number of this function state from pov of* enclosing bpf_verifier_state.* 0 = main function, 1 = first callee.
1127  Ordering of fields matters. See states_equal() 等于g points to bpf_context
1128  mark_reg_known_zero(env, regs, BPF_REG_1)
调用者
名称描述
init_func_state