Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:check_map_access_type

Proto:static int check_map_access_type(struct bpf_verifier_env *env, u32 regno, int off, int size, enum bpf_access_type type)

Type:int

Parameter:

TypeParameterName
struct bpf_verifier_env *env
u32regno
intoff
intsize
enum bpf_access_typetype
2198  regs = cur_regs(env)
2199  map = valid when type == CONST_PTR_TO_MAP | PTR_TO_MAP_VALUE | * PTR_TO_MAP_VALUE_OR_NULL
2200  cap = bpf_map_flags_to_cap(map)
2202  If type == BPF_WRITE && Not (cap & BPF_MAP_CAN_WRITE) Then
2203  verbose(env, "write into map forbidden, value_size=%d off=%d size=%d\n", value_size, off, size)
2205  Return -EACCES
2208  If type == BPF_READ && Not (cap & BPF_MAP_CAN_READ) Then
2209  verbose(env, "read from map forbidden, value_size=%d off=%d size=%d\n", value_size, off, size)
2211  Return -EACCES
2214  Return 0
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 &&
check_helper_mem_access