From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86D85C43334 for ; Wed, 22 Jun 2022 16:46:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376623AbiFVQqW (ORCPT ); Wed, 22 Jun 2022 12:46:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376724AbiFVQqF (ORCPT ); Wed, 22 Jun 2022 12:46:05 -0400 Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ABBE40906 for ; Wed, 22 Jun 2022 09:45:31 -0700 (PDT) Received: from in01.mta.xmission.com ([166.70.13.51]:51690) by out01.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1o43Tu-004y2t-75; Wed, 22 Jun 2022 10:45:30 -0600 Received: from ip68-227-174-4.om.om.cox.net ([68.227.174.4]:57370 helo=email.froward.int.ebiederm.org.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1o43Tq-001XnL-UP; Wed, 22 Jun 2022 10:45:29 -0600 From: "Eric W. Biederman" To: Oleg Nesterov Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, bigeasy@linutronix.de, Peter Zijlstra , Jann Horn , Kees Cook , Alexander Gordeev , Robert O'Callahan , Kyle Huey , Keno Fischer References: <20220421150248.667412396@infradead.org> <20220421150654.817117821@infradead.org> <87czhap9dy.fsf@email.froward.int.ebiederm.org> <878rrrh32q.fsf_-_@email.froward.int.ebiederm.org> <87k0b7v9yk.fsf_-_@email.froward.int.ebiederm.org> <87k0b0apne.fsf_-_@email.froward.int.ebiederm.org> <87a6bv6dl6.fsf_-_@email.froward.int.ebiederm.org> <87r13gd4xy.fsf_-_@email.froward.int.ebiederm.org> Date: Wed, 22 Jun 2022 11:45:20 -0500 In-Reply-To: <87r13gd4xy.fsf_-_@email.froward.int.ebiederm.org> (Eric W. Biederman's message of "Wed, 22 Jun 2022 11:43:37 -0500") Message-ID: <87letod4v3.fsf_-_@email.froward.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1o43Tq-001XnL-UP;;;mid=<87letod4v3.fsf_-_@email.froward.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=68.227.174.4;;;frm=ebiederm@xmission.com;;;spf=softfail X-XM-AID: U2FsdGVkX19c3wZsaos70YdODfLJcA9aZoPCblOi9kQ= X-SA-Exim-Connect-IP: 68.227.174.4 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: [PATCH 1/3] signal: Ensure SIGNAL_GROUP_EXIT gets set in do_group_exit X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function do_group_exit has an optimization that avoids taking siglock and doing the work to find other threads in the signal group and shutting them down. It is very desirable for SIGNAL_GROUP_EXIT to always been set whenever it is decided for the process to exit. That ensures only a single place needs to be tested, and a single bit of state needs to be looked at. This makes the optimization in do_group_exit counter productive. Make the code and maintenance simpler by removing this unnecessary option. Signed-off-by: "Eric W. Biederman" --- kernel/exit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/exit.c b/kernel/exit.c index f072959fcab7..96e4b12edea8 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -905,7 +905,7 @@ do_group_exit(int exit_code) exit_code = sig->group_exit_code; else if (sig->group_exec_task) exit_code = 0; - else if (!thread_group_empty(current)) { + else { struct sighand_struct *const sighand = current->sighand; spin_lock_irq(&sighand->siglock); -- 2.35.3