summaryrefslogtreecommitdiff
path: root/kernel/bpf/syscall.c
diff options
context:
space:
mode:
authorAnay Wadhera <awadhera@berkeley.edu>2021-05-20 21:50:03 -0700
committerMichael Bestas <mkbestas@lineageos.org>2022-04-19 00:49:40 +0300
commita5f81e8c0e893190867f877ccf9501b3d8c70932 (patch)
tree298a899286dbde9cc77d20ba4cc2fceb884c0b7a /kernel/bpf/syscall.c
parent6e5270c40005b8f29dc8e0608829f35789afc13d (diff)
Revert "bpf: skip unnecessary capability check"
This reverts commit c9ea2f8af67399904fe9c72ab5192a0c0ae7f2bf. Signed-off-by: Chatur27 <jasonbright2709@gmail.com>
Diffstat (limited to 'kernel/bpf/syscall.c')
-rw-r--r--kernel/bpf/syscall.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 9361b5855aa7..e4271d66bcd9 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -675,7 +675,7 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, siz
union bpf_attr attr;
int err;
- if (sysctl_unprivileged_bpf_disabled && !capable(CAP_SYS_ADMIN))
+ if (!capable(CAP_SYS_ADMIN) && sysctl_unprivileged_bpf_disabled)
return -EPERM;
if (!access_ok(VERIFY_READ, uattr, 1))