Skip to content

Commit f149b31

Browse files
committed
signal: Never allocate siginfo for SIGKILL or SIGSTOP
The SIGKILL and SIGSTOP signals are never delivered to userspace so queued siginfo for these signals can never be observed. Therefore remove the chance of failure by never even attempting to allocate siginfo in those cases. Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
1 parent 0351505 commit f149b31

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

kernel/signal.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,10 +1054,11 @@ static int __send_signal(int sig, struct siginfo *info, struct task_struct *t,
10541054

10551055
result = TRACE_SIGNAL_DELIVERED;
10561056
/*
1057-
* fast-pathed signals for kernel-internal things like SIGSTOP
1058-
* or SIGKILL.
1057+
* Skip useless siginfo allocation for SIGKILL SIGSTOP,
1058+
* and kernel threads.
10591059
*/
1060-
if ((info == SEND_SIG_FORCED) || (t->flags & PF_KTHREAD))
1060+
if ((info == SEND_SIG_FORCED) ||
1061+
sig_kernel_only(sig) || (t->flags & PF_KTHREAD))
10611062
goto out_set;
10621063

10631064
/*

0 commit comments

Comments
 (0)