Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:bpf_map_get_info_by_fd

Proto:static int bpf_map_get_info_by_fd(struct bpf_map *map, const union bpf_attr *attr, union bpf_attr __user *uattr)

Type:int

Parameter:

TypeParameterName
struct bpf_map *map
const union bpf_attr *attr
union bpf_attr __user *uattr
2754  __user * uinfo = u64_to_user_ptr(info)
2755  struct bpf_map_info info = {}
2756  info_len = info_len
2759  err = If we're handed a bigger struct than we know of, ensure all the unknown bits* are 0 - i.e. new user-space does not rely on any kernel feature extensions* we don't know about yet.* There is a ToCToU between this function call and the following
2760  If err Then Return err
2762  info_len = min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, size of info , info_len)
2764  type = map_type
2765  id = id
2766  key_size = key_size
2767  value_size = value_size
2768  max_entries = max_entries
2769  map_flags = map_flags
2770  No 3D Now!(name, name, size of name )
2772  If btf Then
2773  btf_id = btf_id(btf)
2774  btf_key_type_id = btf_key_type_id
2775  btf_value_type_id = btf_value_type_id
2778  If bpf_map_is_dev_bound(map) Then
2779  err = bpf_map_offload_info_fill( & info, map)
2780  If err Then Return err
2784  If copy_to_user(uinfo, & info, info_len) || Write a simple value into user space(info_len, & info_len) Then Return -EFAULT
2788  Return 0
Caller
NameDescribe
bpf_obj_get_info_by_fd