summaryrefslogtreecommitdiffstats
path: root/security/smack
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-03-26 01:42:50 +0100
committerCasey Schaufler <casey@schaufler-ca.com>2021-05-18 19:36:48 +0200
commit0169d8f33ab7a58675a94c18122dba58d8f6a1b8 (patch)
tree3bef954d23fe126a5072fd085e3aebcfa69dbfbf /security/smack
parentsmackfs: restrict bytes count in smk_set_cipso() (diff)
downloadlinux-0169d8f33ab7a58675a94c18122dba58d8f6a1b8.tar.xz
linux-0169d8f33ab7a58675a94c18122dba58d8f6a1b8.zip
Revert "Smack: Handle io_uring kernel thread privileges"
This reverts commit 942cb357ae7d9249088e3687ee6a00ed2745a0c7. The io_uring PF_IO_WORKER threads no longer have PF_KTHREAD set, so no need to special case them for credential checks. Cc: Casey Schaufler <casey@schaufler-ca.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'security/smack')
-rw-r--r--security/smack/smack_access.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c
index 7eabb448acab..efe2406a3960 100644
--- a/security/smack/smack_access.c
+++ b/security/smack/smack_access.c
@@ -688,10 +688,9 @@ bool smack_privileged_cred(int cap, const struct cred *cred)
bool smack_privileged(int cap)
{
/*
- * Kernel threads may not have credentials we can use.
- * The io_uring kernel threads do have reliable credentials.
+ * All kernel tasks are privileged
*/
- if ((current->flags & (PF_KTHREAD | PF_IO_WORKER)) == PF_KTHREAD)
+ if (unlikely(current->flags & PF_KTHREAD))
return true;
return smack_privileged_cred(cap, current_cred());