]> Git Repo - linux.git/commit - kernel/bpf/verifier.c
bpf, cgroup: implement eBPF-based device controller for cgroup v2
authorRoman Gushchin <[email protected]>
Sun, 5 Nov 2017 13:15:32 +0000 (08:15 -0500)
committerDavid S. Miller <[email protected]>
Sun, 5 Nov 2017 14:26:51 +0000 (23:26 +0900)
commitebc614f687369f9df99828572b1d85a7c2de3d92
treebfcaecb3636c2ef3fd31da33138fe72db50663f2
parentecf8fecb7828648cba0e42de7464a7e600c93459
bpf, cgroup: implement eBPF-based device controller for cgroup v2

Cgroup v2 lacks the device controller, provided by cgroup v1.
This patch adds a new eBPF program type, which in combination
of previously added ability to attach multiple eBPF programs
to a cgroup, will provide a similar functionality, but with some
additional flexibility.

This patch introduces a BPF_PROG_TYPE_CGROUP_DEVICE program type.
A program takes major and minor device numbers, device type
(block/character) and access type (mknod/read/write) as parameters
and returns an integer which defines if the operation should be
allowed or terminated with -EPERM.

Signed-off-by: Roman Gushchin <[email protected]>
Acked-by: Alexei Starovoitov <[email protected]>
Acked-by: Tejun Heo <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
include/linux/bpf-cgroup.h
include/linux/bpf_types.h
include/linux/device_cgroup.h
include/uapi/linux/bpf.h
kernel/bpf/cgroup.c
kernel/bpf/syscall.c
kernel/bpf/verifier.c
tools/include/uapi/linux/bpf.h
This page took 0.061741 seconds and 4 git commands to generate.