signal: Ensure SIGNAL_GROUP_EXIT gets set in do_group_exit
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 21 Jun 2022 17:39:51 +0000 (12:39 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Wed, 20 Jul 2022 15:21:52 +0000 (10:21 -0500)
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.

Link: https://lkml.kernel.org/r/87letod4v3.fsf_-_@email.froward.int.ebiederm.org
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
kernel/exit.c

index 64c938ce36fe8ad0dfa83ffed6a2d596f0a19970..a3929e5e6d6132885b9ccd535c09481132dcc107 100644 (file)
@@ -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);