Revert "Smack: Handle io_uring kernel thread privileges"
authorJens Axboe <axboe@kernel.dk>
Fri, 26 Mar 2021 00:42:50 +0000 (18:42 -0600)
committerCasey Schaufler <casey@schaufler-ca.com>
Tue, 18 May 2021 17:36:48 +0000 (10:36 -0700)
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>
security/smack/smack_access.c

index 7eabb44..efe2406 100644 (file)
@@ -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());