diff mbox series

[RFC,3/9] kernel/fork: Don't inherit PF_USER_WORKER from parent

Message ID 20241209234316.4132786-4-krisman@suse.de (mailing list archive)
State New
Headers show
Series Launching processes with io_uring | expand

Commit Message

Gabriel Krisman Bertazi Dec. 9, 2024, 11:43 p.m. UTC
Clear the PF_USER_WORKER bit of new tasks, instead of inheriting it from
the parent.  This allows PF_USER_WORKER tasks to fork regular tasks.

Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
---
 kernel/fork.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/kernel/fork.c b/kernel/fork.c
index 1450b461d196..56baa320a720 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -2228,6 +2228,8 @@  __latent_entropy struct task_struct *copy_process(
 	p->flags &= ~PF_KTHREAD;
 	if (args->kthread)
 		p->flags |= PF_KTHREAD;
+
+	p->flags &= ~PF_USER_WORKER;
 	if (args->user_worker) {
 		/*
 		 * Mark us a user worker, and block any signal that isn't