Skip to contentSkip to conversation

tomoyo: don't special case PF_IO_WORKER for PF_KTHREAD

PATCH In review Jens Axboe 2 participants 3 messages Mar 26, 2021

Subsystems (2)
lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

PATCH 1/1 tomoyo: don't special case PF_IO_WORKER for PF_KTHREAD

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

---
 security/tomoyo/network.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/tomoyo/network.c +1 -1
index 478f757ff843..8dc61335f65e 100644
@@ -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;
 }
 
 /**
Signature · 4 lines
2.31.0

-- 
Jens Axboe
#1 lore raw
Quoted 2 lines · Jens Axboe

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?

Quoted 20 lines
---
 security/tomoyo/network.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/tomoyo/network.c +1 -1
index 478f757ff843..8dc61335f65e 100644
@@ -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;
 }
 
 /**
author
#2 lore raw
Quoted 5 lines · Casey Schaufler
Quoted 2 lines · Jens Axboe

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 <[email protected]>
Date:   Tue Feb 16 14:15:30 2021 -0700

io-wq: fork worker threads from original task

Signature · 1 line
Jens Axboe