From c7de3d02e678490b3aa0796d9be7dfe5f259374a Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Mon, 21 Sep 2026 15:45:04 +0200 Subject: [PATCH] fork: use SIG_KERNEL_ONLY_MASK for the user worker signal mask For a user worker copy_process() blocks every signal except for SIGKILL and SIGSTOP. Use SIG_KERNEL_ONLY_MASK instead of open-coding it. No functional changes. Link: https://patch.msgid.link/20260921-work-coredump-fixes-v3-15-8e4adb1619e6@kernel.org Acked-by: Oleg Nesterov Signed-off-by: Christian Brauner (Amutable) --- kernel/fork.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kernel/fork.c b/kernel/fork.c index 623eaead3747..1a20264e9b89 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -2140,12 +2140,9 @@ __latent_entropy struct task_struct *copy_process( if (args->kthread) p->flags |= PF_KTHREAD; if (args->user_worker) { - /* - * Mark us a user worker, and block any signal that isn't - * fatal or STOP - */ + /* A user worker takes only the signals nobody can block. */ p->flags |= PF_USER_WORKER; - siginitsetinv(&p->blocked, sigmask(SIGKILL)|sigmask(SIGSTOP)); + siginitsetinv(&p->blocked, SIG_KERNEL_ONLY_MASK); } if (args->io_thread) p->flags |= PF_IO_WORKER;