Skip to content

Commit a436184

Browse files
oleg-nesterovakpm00
authored andcommitted
get_signal: don't initialize ksig->info if SIGNAL_GROUP_EXIT/group_exec_task
This initialization is incomplete and unnecessary, neither do_group_exit() nor PF_USER_WORKER need ksig->info. Link: https://lkml.kernel.org/r/20240226165653.GA20834@redhat.com Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: Christian Brauner <brauner@kernel.org> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Peter Collingbourne <pcc@google.com> Cc: Wen Yang <wenyang.linux@foxmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent dd69edd commit a436184

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

kernel/signal.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2727,12 +2727,15 @@ bool get_signal(struct ksignal *ksig)
27272727
/* Has this task already been marked for death? */
27282728
if ((signal->flags & SIGNAL_GROUP_EXIT) ||
27292729
signal->group_exec_task) {
2730-
clear_siginfo(&ksig->info);
2731-
ksig->info.si_signo = signr = SIGKILL;
2730+
signr = SIGKILL;
27322731
sigdelset(&current->pending.signal, SIGKILL);
27332732
trace_signal_deliver(SIGKILL, SEND_SIG_NOINFO,
2734-
&sighand->action[SIGKILL - 1]);
2733+
&sighand->action[SIGKILL-1]);
27352734
recalc_sigpending();
2735+
/*
2736+
* implies do_group_exit() or return to PF_USER_WORKER,
2737+
* no need to initialize ksig->info/etc.
2738+
*/
27362739
goto fatal;
27372740
}
27382741

0 commit comments

Comments
 (0)