From: Christian Brauner <brauner@kernel.org> stable inclusion from stable-v6.6.163 commit a6b105726213d0366665e8d23572129c3f974bd8 category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/21319 CVE: CVE-2026-99561 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=... -------------------------------- [ Upstream commit e760200370e4de054b6b5f568a7faa911e2956bb ] Only a PF_USER_WORKER thread returns from get_signal() after a fatal signal and can go on to create a thread. get_signal() sets PF_SIGNALED before it dumps core and before it lets a PF_USER_WORKER thread return. That flags sticks. The exec'ing thread itself is never signaled. But it doesn't need the check anyway as we moved cancellation of io_uring requests before de_thread(). create_io_thread() is the only way a signaled thread creates another one. vhost_task_create() is reached from ioctls alone. io_should_retry_thread() doesn't retry -EINTR, so io-wq callers give up the same way they did when copy_process() refused. Suggested-by: Oleg Nesterov <oleg@redhat.com> Link: https://lore.kernel.org/r/aq0VLTyxNatFmLOK@redhat.com Link: https://patch.msgid.link/20260921-work-coredump-fixes-v3-13-8e4adb1619e6@ker... Acked-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org> Stable-dep-of: 1f978881ce6c ("fork: don't create io threads once PF_POSTCOREDUMP is set") Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Yao Yiqi <yaoyiqi3@huawei.com> --- kernel/fork.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/fork.c b/kernel/fork.c index 46b045ab9b81..e98149a6872d 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -3008,6 +3008,10 @@ struct task_struct *create_io_thread(int (*fn)(void *), void *arg, int node) .user_worker = 1, }; + /* A creator past its fatal signal gets no thread. */ + if (current->flags & PF_SIGNALED) + return ERR_PTR(-EINTR); + return copy_process(NULL, 0, node, &args); } -- 2.34.1