Skip to content

Commit 3a017d6

Browse files
hfxspkees
authored andcommitted
signal: Initialize the info in ksignal
When handing the SIGNAL_GROUP_EXIT flag, the info in ksignal isn't cleared. However, the info acquired by dequeue_synchronous_signal/dequeue_signal is initialized and can be safely used. Fortunately, the fatal signal process just uses the si_signo and doesn't use any other member. Even so, the initialization before use is more safer. Signed-off-by: haifeng.xu <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5abf698 commit 3a017d6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/signal.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2693,6 +2693,7 @@ bool get_signal(struct ksignal *ksig)
26932693
/* Has this task already been marked for death? */
26942694
if ((signal->flags & SIGNAL_GROUP_EXIT) ||
26952695
signal->group_exec_task) {
2696+
clear_siginfo(&ksig->info);
26962697
ksig->info.si_signo = signr = SIGKILL;
26972698
sigdelset(&current->pending.signal, SIGKILL);
26982699
trace_signal_deliver(SIGKILL, SEND_SIG_NOINFO,

0 commit comments

Comments
 (0)