OpenCloudOS-Kernel/include/uapi
Daniel Mack f432455148 bpf: add BPF_PROG_ATTACH and BPF_PROG_DETACH commands
Extend the bpf(2) syscall by two new commands, BPF_PROG_ATTACH and
BPF_PROG_DETACH which allow attaching and detaching eBPF programs
to a target.

On the API level, the target could be anything that has an fd in
userspace, hence the name of the field in union bpf_attr is called
'target_fd'.

When called with BPF_ATTACH_TYPE_CGROUP_INET_{E,IN}GRESS, the target is
expected to be a valid file descriptor of a cgroup v2 directory which
has the bpf controller enabled. These are the only use-cases
implemented by this patch at this point, but more can be added.

If a program of the given type already exists in the given cgroup,
the program is swapped automically, so userspace does not have to drop
an existing program first before installing a new one, which would
otherwise leave a gap in which no program is attached.

For more information on the propagation logic to subcgroups, please
refer to the bpf cgroup controller implementation.

The API is guarded by CAP_NET_ADMIN.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-11-25 16:26:04 -05:00
..
asm-generic generic syscalls: kill cruft from removed pkey syscalls 2016-10-17 09:50:56 -07:00
drm Merge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into drm-next 2016-09-28 11:09:59 +10:00
linux bpf: add BPF_PROG_ATTACH and BPF_PROG_DETACH commands 2016-11-25 16:26:04 -05:00
misc cxl: Use fixed width predefined types in data structure. 2016-08-09 16:52:01 +10:00
mtd mtd: kill the nand_ecclayout struct 2016-05-05 23:51:51 +02:00
rdma qedr: Add support for QP verbs 2016-10-14 15:00:10 -04:00
scsi scsi: cxlflash: Transition to application close model 2016-08-23 22:23:41 -04:00
sound Merge remote-tracking branch 'asoc/fix/topology-abi' into asoc-linus 2016-11-04 12:34:05 -06:00
video
xen xen/evtchn: add IOCTL_EVTCHN_RESTRICT 2016-07-25 10:59:31 +01:00
Kbuild