Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Mark a register as having a completely unknown (scalar) value.

Proto:static void __mark_reg_unknown(const struct bpf_verifier_env *env, struct bpf_reg_state *reg)

Type:void

Parameter:

TypeParameterName
const struct bpf_verifier_env *env
struct bpf_reg_state *reg
1065  memset(reg, 0, offsetof(structbpf_reg_state, var_off))
1066  Ordering of fields matters. See states_equal() = g doesn't contain a valid pointer
1067  For scalar types (SCALAR_VALUE), this represents our knowledge of * the actual value. * For pointer types, this represents the variable part of the offset * from the pointed-to object, and is shared with all bpf_reg_states * with the same id as us. = A completely unknown value
1068  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 = 0
1069  if (!precise && SCALAR_VALUE) min/max/tnum don't affect safety = subprog_cnt > 1 || !allow_ptr_leaks ? true : false
1071  Reset the min/max bounds of a register
Caller
NameDescribe
mark_reg_unknown
__mark_reg_not_init
check_stack_boundarywhen register 'regno' is passed into function that will read 'access_size'* bytes from that pointer, make sure that it's within stack boundary* and all elements of stack are initialized
__clear_all_pkt_pointersPacket data might have moved, any old PTR_TO_PACKET[_META,_END]* are now invalid, so turn them into unknown SCALAR_VALUE.
release_reg_references
adjust_ptr_min_max_valsHandles arithmetic on a pointer and a scalar: computes new min/max and var_off.* Caller should also handle BPF_MOV case separately.* If we return -EACCES, caller may want to try again treating pointer as a* scalar
adjust_scalar_min_max_valsWARNING: This function does calculations on 64-bit values, but the actual* execution may occur on 32-bit values. Therefore, things like bitshifts* need extra checks in the 32-bit case.