Merge tag 'Smack-for-5.11-io_uring-fix' of git://github.com/cschaufler/smack-next

Pull smack fix from Casey Schaufler:
"Provide a fix for the incorrect handling of privilege in the face of
io_uring's use of kernel threads. That invalidated an long standing
assumption regarding the privilege of kernel threads.

The fix is simple and safe. It was provided by Jens Axboe and has been
tested"

* tag 'Smack-for-5.11-io_uring-fix' of git://github.com/cschaufler/smack-next:
Smack: Handle io_uring kernel thread privileges

+3 -2
+3 -2
security/smack/smack_access.c
··· 688 688 bool smack_privileged(int cap) 689 689 { 690 690 /* 691 - * All kernel tasks are privileged 691 + * Kernel threads may not have credentials we can use. 692 + * The io_uring kernel threads do have reliable credentials. 692 693 */ 693 - if (unlikely(current->flags & PF_KTHREAD)) 694 + if ((current->flags & (PF_KTHREAD | PF_IO_WORKER)) == PF_KTHREAD) 694 695 return true; 695 696 696 697 return smack_privileged_cred(cap, current_cred());