* + complete_signal-kill-always-true-core_state-signal_group_exit-check.patch added to mm-nonmm-unstable branch
@ 2026-02-22 19:19 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-02-22 19:19 UTC (permalink / raw)
To: mm-commits, mjguzik, kees, brauner, oleg, akpm
The patch titled
Subject: complete_signal: kill always-true "core_state || !SIGNAL_GROUP_EXIT" check
has been added to the -mm mm-nonmm-unstable branch. Its filename is
complete_signal-kill-always-true-core_state-signal_group_exit-check.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/complete_signal-kill-always-true-core_state-signal_group_exit-check.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Oleg Nesterov <oleg@redhat.com>
Subject: complete_signal: kill always-true "core_state || !SIGNAL_GROUP_EXIT" check
Date: Sun, 22 Feb 2026 16:24:00 +0100
The "(signal->core_state || !(signal->flags & SIGNAL_GROUP_EXIT))" check
in complete_signal() is not obvious at all, and in fact it only adds
unnecessary confusion: this condition is always true.
prepare_signal() does:
if (signal->flags & SIGNAL_GROUP_EXIT) {
if (signal->core_state)
return sig == SIGKILL;
/*
* The process is in the middle of dying, drop the signal.
*/
return false;
}
This means that "!signal->core_state && (signal->flags &
SIGNAL_GROUP_EXIT)" in complete_signal() is never possible.
If SIGNAL_GROUP_EXIT is set, prepare_signal() can only return true if
signal->core_state is not NULL.
Link: https://lkml.kernel.org/r/aZsfkDhnqJ4s1oTs@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Kees Cook <kees@kernel.org>
Cc: Mateusz Guzik <mjguzik@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
kernel/signal.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/kernel/signal.c~complete_signal-kill-always-true-core_state-signal_group_exit-check
+++ a/kernel/signal.c
@@ -1000,9 +1000,7 @@ static void complete_signal(int sig, str
* Found a killable thread. If the signal will be fatal,
* then start taking the whole group down immediately.
*/
- if (sig_fatal(p, sig) &&
- (signal->core_state || !(signal->flags & SIGNAL_GROUP_EXIT)) &&
- !sigismember(&t->real_blocked, sig) &&
+ if (sig_fatal(p, sig) && !sigismember(&t->real_blocked, sig) &&
(sig == SIGKILL || !p->ptrace)) {
/*
* This signal will be fatal to the whole group.
_
Patches currently in -mm which might be from oleg@redhat.com are
exit-kill-unnecessary-thread_group_leader-checks-in-exit_notify-and-do_notify_parent.patch
do_notify_parent-sanitize-the-valid_signal-checks.patch
complete_signal-kill-always-true-core_state-signal_group_exit-check.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-02-22 19:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-22 19:19 + complete_signal-kill-always-true-core_state-signal_group_exit-check.patch added to mm-nonmm-unstable branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.