linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tomoyo: don't special case PF_IO_WORKER for PF_KTHREAD
@ 2021-03-26  0:44 Jens Axboe
  2021-03-26 16:03 ` Casey Schaufler
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2021-03-26  0:44 UTC (permalink / raw)
  To: Kentaro Takeda, Tetsuo Handa; +Cc: linux-security-module, LKML

The io_uring PF_IO_WORKER threads no longer have PF_KTHREAD set, so no
need to special case them for credential checks.

Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 security/tomoyo/network.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/tomoyo/network.c b/security/tomoyo/network.c
index 478f757ff843..8dc61335f65e 100644
--- a/security/tomoyo/network.c
+++ b/security/tomoyo/network.c
@@ -613,7 +613,7 @@ static int tomoyo_check_unix_address(struct sockaddr *addr,
 static bool tomoyo_kernel_service(void)
 {
 	/* Nothing to do if I am a kernel service. */
-	return (current->flags & (PF_KTHREAD | PF_IO_WORKER)) == PF_KTHREAD;
+	return current->flags & PF_KTHREAD;
 }
 
 /**
-- 
2.31.0

-- 
Jens Axboe


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tomoyo: don't special case PF_IO_WORKER for PF_KTHREAD
  2021-03-26  0:44 [PATCH] tomoyo: don't special case PF_IO_WORKER for PF_KTHREAD Jens Axboe
@ 2021-03-26 16:03 ` Casey Schaufler
  2021-03-26 16:05   ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Casey Schaufler @ 2021-03-26 16:03 UTC (permalink / raw)
  To: Jens Axboe, Kentaro Takeda, Tetsuo Handa; +Cc: linux-security-module, LKML

On 3/25/2021 5:44 PM, Jens Axboe wrote:
> 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 where that change was made?

>
> Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> ---
>  security/tomoyo/network.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/security/tomoyo/network.c b/security/tomoyo/network.c
> index 478f757ff843..8dc61335f65e 100644
> --- a/security/tomoyo/network.c
> +++ b/security/tomoyo/network.c
> @@ -613,7 +613,7 @@ static int tomoyo_check_unix_address(struct sockaddr *addr,
>  static bool tomoyo_kernel_service(void)
>  {
>  	/* Nothing to do if I am a kernel service. */
> -	return (current->flags & (PF_KTHREAD | PF_IO_WORKER)) == PF_KTHREAD;
> +	return current->flags & PF_KTHREAD;
>  }
>  
>  /**

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tomoyo: don't special case PF_IO_WORKER for PF_KTHREAD
  2021-03-26 16:03 ` Casey Schaufler
@ 2021-03-26 16:05   ` Jens Axboe
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2021-03-26 16:05 UTC (permalink / raw)
  To: Casey Schaufler, Kentaro Takeda, Tetsuo Handa; +Cc: linux-security-module, LKML

On 3/26/21 10:03 AM, Casey Schaufler wrote:
> On 3/25/2021 5:44 PM, Jens Axboe wrote:
>> 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 where that change was made?

See previous reply, same one:

commit 3bfe6106693b6b4ba175ad1f929c4660b8f59ca8
Author: Jens Axboe <axboe@kernel.dk>
Date:   Tue Feb 16 14:15:30 2021 -0700

    io-wq: fork worker threads from original task

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-26 16:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-26  0:44 [PATCH] tomoyo: don't special case PF_IO_WORKER for PF_KTHREAD Jens Axboe
2021-03-26 16:03 ` Casey Schaufler
2021-03-26 16:05   ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).