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/[email protected] Signed-off-by: Oleg Nesterov <[email protected]> Cc: Christian Brauner <[email protected]> Cc: Eric W. Biederman <[email protected]> Cc: Peter Collingbourne <[email protected]> Cc: Wen Yang <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent dd69edd commit a436184

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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)