Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\core.c Create Date:2022-07-28 12:50:01
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:bpf_prog_array_copy_to_user

Proto:int bpf_prog_array_copy_to_user(struct bpf_prog_array *array, __u32 __user *prog_ids, u32 cnt)

Type:int

Parameter:

TypeParameterName
struct bpf_prog_array *array
__u32 __user *prog_ids
u32cnt
1920  err = 0
1930  ids = kcalloc - allocate memory for an array. The memory is set to zero.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
1931  If Not ids Then Return -ENOMEM
1933  nospc = bpf_prog_array_copy_core(array, ids, cnt)
1934  err = copy_to_user(prog_ids, ids, cnt * sizeof(u32))
1935  kfree(ids)
1936  If err Then Return -EFAULT
1938  If nospc Then Return -ENOSPC
1940  Return 0
Caller
NameDescribe
__cgroup_bpf_queryMust be called with cgroup_mutex held to avoid races.