diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2018-01-18 22:38:59 +0100 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-01-18 22:39:40 +0100 |
commit | 0c91c4239d23d44a5cb95f51e9d4b71d88793d75 (patch) | |
tree | 7ca9af66f490c3d959c3c6e9042bf86b1c513563 /kernel | |
parent | e7b2823a582a5bca5ee47644f448e317178e8824 (diff) | |
parent | 111e6b45315c8d13658f23885b30eb9df3ea2914 (diff) |
Merge branch 'bpf-improve-test-verifier-coverage'
Alexei Starovoitov says:
====================
BPF verifier has 700+ tests used to check correctness of the verifier.
Beyond checking the verifier log tell kernel to run accepted programs
as well via bpf_prog_test_run() command. That improves quality of the
tests and increases bpf test coverage.
====================
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/bpf/syscall.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index c28524483bf4..97a825ffc763 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -1504,6 +1504,8 @@ static int bpf_prog_test_run(const union bpf_attr *attr, struct bpf_prog *prog; int ret = -ENOTSUPP; + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; if (CHECK_ATTR(BPF_PROG_TEST_RUN)) return -EINVAL; |