Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Oleg Nesterov and committed by
Andrew Morton
a436184e dd69edd6

+6 -3
+6 -3
kernel/signal.c
··· 2727 2727 /* Has this task already been marked for death? */ 2728 2728 if ((signal->flags & SIGNAL_GROUP_EXIT) || 2729 2729 signal->group_exec_task) { 2730 - clear_siginfo(&ksig->info); 2731 - ksig->info.si_signo = signr = SIGKILL; 2730 + signr = SIGKILL; 2732 2731 sigdelset(&current->pending.signal, SIGKILL); 2733 2732 trace_signal_deliver(SIGKILL, SEND_SIG_NOINFO, 2734 - &sighand->action[SIGKILL - 1]); 2733 + &sighand->action[SIGKILL-1]); 2735 2734 recalc_sigpending(); 2735 + /* 2736 + * implies do_group_exit() or return to PF_USER_WORKER, 2737 + * no need to initialize ksig->info/etc. 2738 + */ 2736 2739 goto fatal; 2737 2740 } 2738 2741