diff options
author | Roman Gushchin <[email protected]> | 2017-11-05 08:15:34 -0500 |
---|---|---|
committer | David S. Miller <[email protected]> | 2017-11-05 23:26:51 +0900 |
commit | 37f1ba0909dfa12c75f8e8ea7a2f01355ebd60f1 (patch) | |
tree | a6b3aebc786eeb512dfde7d6bae130cc136ede4b /net/switchdev/switchdev.c | |
parent | 9d1f15941967cd80fc3baa3322751fab532f98a4 (diff) |
selftests/bpf: add a test for device cgroup controller
Add a test for device cgroup controller.
The test loads a simple bpf program which logs all
device access attempts using trace_printk() and forbids
all operations except operations with /dev/zero and
/dev/urandom.
Then the test creates and joins a test cgroup, and attaches
the bpf program to it.
Then it tries to perform some simple device operations
and checks the result:
create /dev/null (should fail)
create /dev/zero (should pass)
copy data from /dev/urandom to /dev/zero (should pass)
copy data from /dev/urandom to /dev/full (should fail)
copy data from /dev/random to /dev/zero (should fail)
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]>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions