From: ebiederm@xmission.com (Eric W. Biederman)
To: Casey Schaufler <casey@schaufler-ca.com>
Cc: "SMACK-discuss\@lists.01.org" <SMACK-discuss@lists.01.org>,
Linux Security Module list
<linux-security-module@vger.kernel.org>,
Jens Axboe <axboe@kernel.dk>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Smack: Handle io_uring kernel thread privileges.
Date: Mon, 21 Dec 2020 13:55:01 -0600 [thread overview]
Message-ID: <877dpbkk8a.fsf@x220.int.ebiederm.org> (raw)
In-Reply-To: <dacfb329-de66-d0cf-dcf9-f030ea1370de@schaufler-ca.com> (Casey Schaufler's message of "Thu, 17 Dec 2020 17:12:29 -0800")
Casey Schaufler <casey@schaufler-ca.com> writes:
> Smack assumes that kernel threads are privileged for smackfs
> operations. This was necessary because the credential of the
> kernel thread was not related to a user operation. With io_uring
> the credential does reflect a user's rights and can be used.
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
>
> Suggested-by: Jens Axboe <axboe@kernel.dk>
> Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
> ---
> security/smack/smack_access.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c
> index efe2406a3960..7eabb448acab 100644
> --- a/security/smack/smack_access.c
> +++ b/security/smack/smack_access.c
> @@ -688,9 +688,10 @@ bool smack_privileged_cred(int cap, const struct cred *cred)
> bool smack_privileged(int cap)
> {
> /*
> - * All kernel tasks are privileged
> + * Kernel threads may not have credentials we can use.
> + * The io_uring kernel threads do have reliable credentials.
> */
> - if (unlikely(current->flags & PF_KTHREAD))
> + if ((current->flags & (PF_KTHREAD | PF_IO_WORKER)) == PF_KTHREAD)
> return true;
>
> return smack_privileged_cred(cap, current_cred());
next prev parent reply other threads:[~2020-12-21 19:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <dacfb329-de66-d0cf-dcf9-f030ea1370de.ref@schaufler-ca.com>
2020-12-18 1:12 ` [PATCH] Smack: Handle io_uring kernel thread privileges Casey Schaufler
2020-12-21 19:55 ` Eric W. Biederman [this message]
2020-12-22 2:05 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877dpbkk8a.fsf@x220.int.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=SMACK-discuss@lists.01.org \
--cc=axboe@kernel.dk \
--cc=casey@schaufler-ca.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox