aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2018-09-03 03:50:36 -0400
committerEric W. Biederman <ebiederm@xmission.com>2018-09-11 15:19:28 -0400
commitf149b31557446aff9ca96d4be7e39cc266f6e7cc (patch)
tree2fcd6f912dbde8435daa1932569fc25697894d10 /kernel/signal.c
parent035150540545f62bada95860ba00fe1e0cd62f63 (diff)
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>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 20931a892ace..d7d1adf735f4 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1054,10 +1054,11 @@ static int __send_signal(int sig, struct siginfo *info, struct task_struct *t,
1054 1054
1055 result = TRACE_SIGNAL_DELIVERED; 1055 result = TRACE_SIGNAL_DELIVERED;
1056 /* 1056 /*
1057 * fast-pathed signals for kernel-internal things like SIGSTOP 1057 * Skip useless siginfo allocation for SIGKILL SIGSTOP,
1058 * or SIGKILL. 1058 * and kernel threads.
1059 */ 1059 */
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))
1061 goto out_set; 1062 goto out_set;
1062 1063
1063 /* 1064 /*