]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
seccomp: Set PF_SUPERPRIV when checking capability
authorMickaël Salaün <mic@linux.microsoft.com>
Fri, 30 Oct 2020 12:38:49 +0000 (13:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Nov 2020 12:29:24 +0000 (13:29 +0100)
commit09652ebd0dc1a4fd0069410261eea55bd8f6df6c
tree087c98cdb5d31ac3fae41fac0099c13fb9d5d3ff
parentfa9ccc177754a608f93bc9ca972f96da8850233f
seccomp: Set PF_SUPERPRIV when checking capability

commit fb14528e443646dd3fd02df4437fcf5265b66baa upstream.

Replace the use of security_capable(current_cred(), ...) with
ns_capable_noaudit() which set PF_SUPERPRIV.

Since commit 98f368e9e263 ("kernel: Add noaudit variant of
ns_capable()"), a new ns_capable_noaudit() helper is available.  Let's
use it!

Cc: Jann Horn <jannh@google.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Tyler Hicks <tyhicks@linux.microsoft.com>
Cc: Will Drewry <wad@chromium.org>
Cc: stable@vger.kernel.org
Fixes: e2cfabdfd075 ("seccomp: add system call filtering using BPF")
Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
Reviewed-by: Jann Horn <jannh@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20201030123849.770769-3-mic@digikod.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/seccomp.c