Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\syscall.c Create Date:2022-07-28 12:52:08
Last Modify:2022-05-19 18:06:12 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:map_check_btf

Proto:static int map_check_btf(struct bpf_map *map, const struct btf *btf, u32 btf_key_id, u32 btf_value_id)

Type:int

Parameter:

TypeParameterName
struct bpf_map *map
const struct btf *btf
u32btf_key_id
u32btf_value_id
588  ret = 0
591  If btf_key_id Then
592  key_type = btf_type_id_size(btf, & btf_key_id, & key_size)
593  If Not key_type || key_size != key_size Then Return -EINVAL
595  Else
596  key_type = btf_type_by_id(btf, 0)
597  If Not map_check_btf Then Return -EINVAL
601  value_type = btf_type_id_size(btf, & btf_value_id, & value_size)
602  If Not value_type || value_size != value_size Then Return -EINVAL
605  >=0 valid offset, <0 error = btf_find_spin_lock(btf, value_type)
607  If map_value_has_spin_lock(map) Then
608  If map_flags & Flags for accessing BPF object from program side. Then Return -EACCES
610  If map_type != BPF_MAP_TYPE_HASH && map_type != BPF_MAP_TYPE_ARRAY && map_type != BPF_MAP_TYPE_CGROUP_STORAGE && map_type != BPF_MAP_TYPE_SK_STORAGE Then Return -Operation is not supported
617  WARN_ONCE(1, "verifier bug spin_lock_off %d value_size %d\n", >=0 valid offset, <0 error , value_size)
620  Return -EFAULT
624  If map_check_btf Then ret = map_check_btf(map, btf, key_type, value_type)
627  Return ret
Caller
NameDescribe
map_createalled via syscall