Patch "bpf: skip unnecessary capability check" has been added to the 4.4-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
bpf: skip unnecessary capability check
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
bpf-skip-unnecessary-capability-check.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
0fa4fe85f4724fff89b09741c437cbee9cf8b008Mon Sep 17 00:00:00 2001
From: Chenbo Feng <[email protected]>
Date: Mon, 19 Mar 2018 17:57:27 -0700
Subject: bpf: skip unnecessary capability check
From: Chenbo Feng <[email protected]>
commit 0fa4fe85f4724fff89b09741c437cbee9cf8b008 upstream.
The current check statement in BPF syscall will do a capability check for CAP_SYS_ADMIN before checking sysctl_unprivileged_bpf_disabled. This code path will trigger unnecessary security hooks on capability checking and cause false alarms on unprivileged process trying to get CAP_SYS_ADMIN access. This can be resolved by simply switch the order of the statement and CAP_SYS_ADMIN is not required anyway if unprivileged bpf syscall is allowed.
--- kernel/bpf/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/syscall.c +1 -1
@@ -673,7 +673,7 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpfunion bpf_attr attr = {};int err; -if (!capable (CAP_SYS_ADMIN ) && sysctl_unprivileged_bpf_disabled) +if (sysctl_unprivileged_bpf_disabled && !capable (CAP_SYS_ADMIN ))return -EPERM ;if (!access_ok (VERIFY_READ , uattr,1 ))
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/kbuild-disable-clang-s-default-use-of-fmerge-all-constants.patch queue-4.4/bpf-skip-unnecessary-capability-check.patch