[PATCH v3 net-next 0/5] eBPF-based device cgroup controller
From: Roman Gushchin
Date: Thu Nov 02 2017 - 13:16:38 EST
This patchset introduces an eBPF-based device controller for cgroup v2.
Patches (1) and (2) are a preparational work required to share some code
with the existing device controller implementation.
Patch (3) is the main patch, which introduces a new bpf prog type
and all necessary infrastructure.
Patch (4) moves cgroup_helpers.c/h to use them by patch (4).
Patch (5) implements an example of eBPF program which controls access
to device files and corresponding userspace test.
v3:
Renamed constants introduced by patch (3) to BPF_DEVCG_*
v2:
Added patch (1).
v1:
https://lkml.org/lkml/2017/11/1/363
Roman Gushchin (5):
device_cgroup: add DEVCG_ prefix to ACC_* and DEV_* constants
device_cgroup: prepare code for bpf-based device controller
bpf, cgroup: implement eBPF-based device controller for cgroup v2
bpf: move cgroup_helpers from samples/bpf/ to
tools/testing/selftesting/bpf/
selftests/bpf: add a test for device cgroup controller
include/linux/bpf-cgroup.h | 15 ++++
include/linux/bpf_types.h | 3 +
include/linux/device_cgroup.h | 67 +++++++++++++++-
include/uapi/linux/bpf.h | 15 ++++
kernel/bpf/cgroup.c | 67 ++++++++++++++++
kernel/bpf/syscall.c | 7 ++
kernel/bpf/verifier.c | 1 +
samples/bpf/Makefile | 5 +-
security/device_cgroup.c | 91 ++++++---------------
tools/include/uapi/linux/bpf.h | 15 ++++
tools/testing/selftests/bpf/Makefile | 6 +-
.../testing/selftests}/bpf/cgroup_helpers.c | 0
.../testing/selftests}/bpf/cgroup_helpers.h | 0
tools/testing/selftests/bpf/dev_cgroup.c | 60 ++++++++++++++
tools/testing/selftests/bpf/test_dev_cgroup.c | 93 ++++++++++++++++++++++
15 files changed, 369 insertions(+), 76 deletions(-)
rename {samples => tools/testing/selftests}/bpf/cgroup_helpers.c (100%)
rename {samples => tools/testing/selftests}/bpf/cgroup_helpers.h (100%)
create mode 100644 tools/testing/selftests/bpf/dev_cgroup.c
create mode 100644 tools/testing/selftests/bpf/test_dev_cgroup.c
--
2.13.6