Skip to contentSkip to conversation

complete_signal-kill-always-true-core_state-signal_group_exit-check.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Mar 28

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled

     Subject: complete_signal: kill always-true "core_state || !SIGNAL_GROUP_EXIT" check

has been removed from the -mm tree. Its filename was
complete_signal-kill-always-true-core_state-signal_group_exit-check.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Oleg Nesterov <[email protected]>
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.

Cc; Deepanshu Kartikey <[email protected]>

---

 kernel/signal.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/signal.c renamed from kernel/signal.c~complete_signal-kill-always-true-core_state-signal_group_exit-check +1 -3
@@ -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 [email protected] are

kernel-fork-validate-exit_signal-in-kernel_clone-fix.patch