函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:bpf_map_get_info_by_fd

函数原型:static int bpf_map_get_info_by_fd(struct bpf_map *map, const union bpf_attr *attr, union bpf_attr __user *uattr)

返回类型:int

参数:

类型参数名称
struct bpf_map *map
const union bpf_attr *attr
union bpf_attr __user *uattr
2754  __useruinfo等于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  如果err则返回: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, 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  内存复制(name, name, name的长度)
2772  如果btf
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  如果bpf_map_is_dev_bound(map)则
2779  err等于bpf_map_offload_info_fill( & info, map)
2780  如果err则返回:err
2784  如果copy_to_user(uinfo, & info, info_len)或put_user - Write a simple value into user space(info_len, & info_len)则返回:负EFAULT
2788  返回:0
调用者
名称描述
bpf_obj_get_info_by_fd