函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:check_map_prog_compatibility

函数原型:static int check_map_prog_compatibility(struct bpf_verifier_env *env, struct bpf_map *map, struct bpf_prog *prog)

返回类型:int

参数:

类型参数名称
struct bpf_verifier_env *env
struct bpf_map *map
struct bpf_prog *prog
8127  如果 Type of BPF program 恒等于BPF_PROG_TYPE_PERF_EVENT
8128  如果非check_map_prealloc(map)则
8129  verbose(env, "perf_event programs can only use preallocated hash map\n")
8130  返回:负EINVAL
8134  verbose(env, "perf_event programs can only use preallocated inner hash map\n")
8135  返回:负EINVAL
8139  如果is_tracing_prog_type( Type of BPF program )或 Type of BPF program 恒等于BPF_PROG_TYPE_SOCKET_FILTER的值且map_value_has_spin_lock(map)则
8142  verbose(env, "tracing progs cannot use bpf_spin_lock yet\n")
8143  返回:负EINVAL
8146  如果bpf_prog_is_dev_bound( Auxiliary fields )或bpf_map_is_dev_bound(map)的值且非bpf_offload_prog_map_match(prog, map)则
8148  verbose(env, "offload device mismatch between prog and map\n")
8149  返回:负EINVAL
8152  返回:0
调用者
名称描述
replace_map_fd_with_map_ptrlook for pseudo eBPF instructions that access map FDs and* replace them with actual map pointers