Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:bpf_prog_detach

Proto:static int bpf_prog_detach(const union bpf_attr *attr)

Type:int

Parameter:

TypeParameterName
const union bpf_attr *attr
2148  If Not Check operation authority Then Return -EPERM
2151  If helper macro to check that unused fields 'union bpf_attr' are zero (BPF_PROG_DETACH) Then Return -EINVAL
2155  Case attach_type == BPF_CGROUP_INET_INGRESS
2156  Case attach_type == BPF_CGROUP_INET_EGRESS
2157  ptype = BPF_PROG_TYPE_CGROUP_SKB
2158  Break
2159  Case attach_type == BPF_CGROUP_INET_SOCK_CREATE
2160  Case attach_type == BPF_CGROUP_INET4_POST_BIND
2161  Case attach_type == BPF_CGROUP_INET6_POST_BIND
2162  ptype = BPF_PROG_TYPE_CGROUP_SOCK
2163  Break
2164  Case attach_type == BPF_CGROUP_INET4_BIND
2165  Case attach_type == BPF_CGROUP_INET6_BIND
2166  Case attach_type == BPF_CGROUP_INET4_CONNECT
2167  Case attach_type == BPF_CGROUP_INET6_CONNECT
2168  Case attach_type == BPF_CGROUP_UDP4_SENDMSG
2169  Case attach_type == BPF_CGROUP_UDP6_SENDMSG
2170  Case attach_type == BPF_CGROUP_UDP4_RECVMSG
2171  Case attach_type == BPF_CGROUP_UDP6_RECVMSG
2172  ptype = BPF_PROG_TYPE_CGROUP_SOCK_ADDR
2173  Break
2174  Case attach_type == BPF_CGROUP_SOCK_OPS
2175  ptype = BPF_PROG_TYPE_SOCK_OPS
2176  Break
2177  Case attach_type == BPF_CGROUP_DEVICE
2178  ptype = BPF_PROG_TYPE_CGROUP_DEVICE
2179  Break
2180  Case attach_type == BPF_SK_MSG_VERDICT
2181  Return sock_map_get_from_fd(attr, NULL)
2182  Case attach_type == BPF_SK_SKB_STREAM_PARSER
2183  Case attach_type == BPF_SK_SKB_STREAM_VERDICT
2184  Return sock_map_get_from_fd(attr, NULL)
2185  Case attach_type == BPF_LIRC_MODE2
2186  Return lirc_prog_detach(attr)
2187  Case attach_type == BPF_FLOW_DISSECTOR
2188  Return skb_flow_dissector_bpf_prog_detach(attr)
2189  Case attach_type == BPF_CGROUP_SYSCTL
2190  ptype = BPF_PROG_TYPE_CGROUP_SYSCTL
2191  Break
2192  Case attach_type == BPF_CGROUP_GETSOCKOPT
2193  Case attach_type == BPF_CGROUP_SETSOCKOPT
2194  ptype = BPF_PROG_TYPE_CGROUP_SOCKOPT
2195  Break
2196  Default
2197  Return -EINVAL
2200  Return cgroup_bpf_prog_detach(attr, ptype)