Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\verifier.c Create Date:2022-07-28 12:56:42
Last Modify:2022-05-19 20:02:10 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:init_reg_state

Proto:static void init_reg_state(struct bpf_verifier_env *env, struct bpf_func_state *state)

Type:void

Parameter:

TypeParameterName
struct bpf_verifier_env *env
struct bpf_func_state *state
1111  regs = regs
1114  When i < BPF has 10 general purpose 64-bit registers and stack frame. cycle
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)
Caller
NameDescribe
init_func_state