diff options
author | Daniel Mack <daniel@zonque.org> | 2016-11-23 16:52:27 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-25 22:26:04 +0100 |
commit | f4324551489e8781d838f941b7aee4208e52e8bf (patch) | |
tree | e7ade301a580bb2165560e7dcf8158b7e37767ee /crypto/dh.c | |
parent | cgroup: add support for eBPF programs (diff) | |
download | linux-f4324551489e8781d838f941b7aee4208e52e8bf.tar.xz linux-f4324551489e8781d838f941b7aee4208e52e8bf.zip |
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>
Diffstat (limited to 'crypto/dh.c')
0 files changed, 0 insertions, 0 deletions