函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:check_map_access_type

函数原型:static int check_map_access_type(struct bpf_verifier_env *env, u32 regno, int off, int size, enum bpf_access_type type)

返回类型:int

参数:

类型参数名称
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  如果type恒等于BPF_WRITE且非cap按位与BPF_MAP_CAN_WRITE的值则
2203  verbose(env, "write into map forbidden, value_size=%d off=%d size=%d\n", value_size, off, size)
2205  返回:负EACCES
2208  如果type恒等于BPF_READ且非cap按位与BPF_MAP_CAN_READ的值则
2209  verbose(env, "read from map forbidden, value_size=%d off=%d size=%d\n", value_size, off, size)
2211  返回:负EACCES
2214  返回:0
调用者
名称描述
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