From nobody Fri Apr 17 07:44:01 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62F6D1E7C03 for ; Sun, 22 Feb 2026 15:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771773850; cv=none; b=J6wlm/WRPJsZ7rSEm3J7OFi/ftBtoFlyF7sQXJu1g+X2zg+q5sb680Y+v8J2sDi9QrT+6nDhpJOOEGtpkvMhFUVzKZ//WEFHGE6FJd8ozYuBRDkK+1bJi3sr0NaM2FRwKOs0NPOB5sru//xvoVgK700j6eHW6GLI/TQ06XWvcys= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771773850; c=relaxed/simple; bh=szC15AzJKyrF6lKwctILRLMp0mqMSRhEqK1PdVsU55U=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=ohnnJKtG2sFet8m6946hp7x/LDjifsAZoZIYEgJhu6NWKJXHhVjYVJhhVYUVYZw4HvY9Gq9VKwHYO/pTNiBFLqvY8JbXiNOIt/N9t0vTPnpEcXRC28aKFeqGNfjpjJ/kMiWilnRILhoSbmWQOiZajtPjtHkjtwfaUAqxQ2ISFPg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ZSXcrXYc; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZSXcrXYc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771773848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=K8PlifPuCVEP/bpVTH72Ug6Kr1ghBnLBO5J12TM757A=; b=ZSXcrXYcBFR+1yb7GLdjl5o+D6JjadLwsmpM2YjWaKiXf3+9gTtLED4Cp67O9GBlypnsru poNSE1CIOMIetO4A0K+qL76ZEPJ4ulXtekZnz1lUHlXAKOP0ZTdLJufX+Y9hMDDgIwYTIV yCWVS3m2gWH2jZejGYbk3kQFiqBBMA8= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-101-KRsaUH-INz6HevKSElbCQQ-1; Sun, 22 Feb 2026 10:24:04 -0500 X-MC-Unique: KRsaUH-INz6HevKSElbCQQ-1 X-Mimecast-MFC-AGG-ID: KRsaUH-INz6HevKSElbCQQ_1771773843 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C6D8218003F6; Sun, 22 Feb 2026 15:24:03 +0000 (UTC) Received: from fedora (unknown [10.44.32.38]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 0D1503000C26; Sun, 22 Feb 2026 15:24:01 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sun, 22 Feb 2026 16:24:03 +0100 (CET) Date: Sun, 22 Feb 2026 16:24:00 +0100 From: Oleg Nesterov To: Andrew Morton Cc: Christian Brauner , Mateusz Guzik , linux-kernel@vger.kernel.org Subject: [PATCH] complete_signal: kill always-true "core_state || !SIGNAL_GROUP_EXIT" check Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D=3D 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. Signed-off-by: Oleg Nesterov --- kernel/signal.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/signal.c b/kernel/signal.c index a56a4413699b..683ef92f7234 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1000,9 +1000,7 @@ static void complete_signal(int sig, struct task_stru= ct *p, enum pid_type type) * 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 =3D=3D SIGKILL || !p->ptrace)) { /* * This signal will be fatal to the whole group. --=20 2.52.0