Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:check_map_prog_compatibility

Proto:static int check_map_prog_compatibility(struct bpf_verifier_env *env, struct bpf_map *map, struct bpf_prog *prog)

Type:int

Parameter:

TypeParameterName
struct bpf_verifier_env *env
struct bpf_map *map
struct bpf_prog *prog
8127  If Type of BPF program == BPF_PROG_TYPE_PERF_EVENT Then
8128  If Not check_map_prealloc(map) Then
8129  verbose(env, "perf_event programs can only use preallocated hash map\n")
8130  Return -EINVAL
8134  verbose(env, "perf_event programs can only use preallocated inner hash map\n")
8135  Return -EINVAL
8139  If (is_tracing_prog_type( Type of BPF program ) || Type of BPF program == BPF_PROG_TYPE_SOCKET_FILTER ) && map_value_has_spin_lock(map) Then
8142  verbose(env, "tracing progs cannot use bpf_spin_lock yet\n")
8143  Return -EINVAL
8146  If (bpf_prog_is_dev_bound( Auxiliary fields ) || bpf_map_is_dev_bound(map)) && Not bpf_offload_prog_map_match(prog, map) Then
8148  verbose(env, "offload device mismatch between prog and map\n")
8149  Return -EINVAL
8152  Return 0
Caller
NameDescribe
replace_map_fd_with_map_ptrlook for pseudo eBPF instructions that access map FDs and* replace them with actual map pointers