lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cc7dc28e-f812-a719-ce0c-a288d8facf72@schaufler-ca.com>
Date:   Fri, 26 Mar 2021 09:00:34 -0700
From:   Casey Schaufler <casey@...aufler-ca.com>
To:     Jens Axboe <axboe@...nel.dk>
Cc:     linux-security-module@...r.kernel.org,
        LKML <linux-kernel@...r.kernel.org>,
        Casey Schaufler <casey@...aufler-ca.com>
Subject: Re: [PATCH] Revert "Smack: Handle io_uring kernel thread privileges"

On 3/25/2021 5:42 PM, Jens Axboe wrote:
> 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.

Could you cite the commit making that change?
I wouldn't want to see this change back-ported to a kernel
that doesn't have that change as well.

>
> Cc: Casey Schaufler <casey@...aufler-ca.com>
> Signed-off-by: Jens Axboe <axboe@...nel.dk>
> ---
>  security/smack/smack_access.c | 5 ++---
>  1 file 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());

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ