Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:runcate register to smaller size (in bytes)* must be called with size < BPF_REG_SIZE

Proto:static void coerce_reg_to_size(struct bpf_reg_state *reg, int size)

Type:void

Parameter:

TypeParameterName
struct bpf_reg_state *reg
intsize
2799  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. = Return @a with all but the lowest @size bytes cleared
2802  mask = (1 << size * 8 ) - 1
2803  If ( minimum possible (u64)value & ~mask) == ( maximum possible (u64)value & ~mask) Then
2804  minimum possible (u64)value &= mask
2805  maximum possible (u64)value &= mask
2806  Else
2807  minimum possible (u64)value = 0
2808  maximum possible (u64)value = mask
2810  minimum possible (s64)value = minimum possible (u64)value
2811  maximum possible (s64)value = maximum possible (u64)value
Caller
NameDescribe
check_mem_accessheck whether memory at (regno + off) is accessible for t = (read | write)* if t==write, value_regno is a register which value is stored into memory* if t==read, value_regno is a register which will receive the value from memory* if t==write &&
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.
check_alu_opheck validity of 32-bit and 64-bit arithmetic operations
is_branch_takenmpute branch direction of the expression "if (reg opcode val) goto target;"* and return:* 1 - branch will be taken and "goto target" will be executed* 0 - branch will not be taken and fall-through to next insn* -1 - unknown
check_cond_jmp_op