]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/kernel-signal.c-trace_signal_deliver-when-signal_group_exit.patch
4.4-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.4 / kernel-signal.c-trace_signal_deliver-when-signal_group_exit.patch
CommitLineData
37ddba70
GKH
1From 98af37d624ed8c83f1953b1b6b2f6866011fc064 Mon Sep 17 00:00:00 2001
2From: Zhenliang Wei <weizhenliang@huawei.com>
3Date: Fri, 31 May 2019 22:30:52 -0700
4Subject: kernel/signal.c: trace_signal_deliver when signal_group_exit
5
6From: Zhenliang Wei <weizhenliang@huawei.com>
7
8commit 98af37d624ed8c83f1953b1b6b2f6866011fc064 upstream.
9
10In the fixes commit, removing SIGKILL from each thread signal mask and
11executing "goto fatal" directly will skip the call to
12"trace_signal_deliver". At this point, the delivery tracking of the
13SIGKILL signal will be inaccurate.
14
15Therefore, we need to add trace_signal_deliver before "goto fatal" after
16executing sigdelset.
17
18Note: SEND_SIG_NOINFO matches the fact that SIGKILL doesn't have any info.
19
20Link: http://lkml.kernel.org/r/20190425025812.91424-1-weizhenliang@huawei.com
21Fixes: cf43a757fd4944 ("signal: Restore the stop PTRACE_EVENT_EXIT")
22Signed-off-by: Zhenliang Wei <weizhenliang@huawei.com>
23Reviewed-by: Christian Brauner <christian@brauner.io>
24Reviewed-by: Oleg Nesterov <oleg@redhat.com>
25Cc: Eric W. Biederman <ebiederm@xmission.com>
26Cc: Ivan Delalande <colona@arista.com>
27Cc: Arnd Bergmann <arnd@arndb.de>
28Cc: Thomas Gleixner <tglx@linutronix.de>
29Cc: Deepa Dinamani <deepa.kernel@gmail.com>
30Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
31Cc: <stable@vger.kernel.org>
32Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
33Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
34Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
35
36---
37 kernel/signal.c | 2 ++
38 1 file changed, 2 insertions(+)
39
40--- a/kernel/signal.c
41+++ b/kernel/signal.c
42@@ -2244,6 +2244,8 @@ relock:
43 if (signal_group_exit(signal)) {
44 ksig->info.si_signo = signr = SIGKILL;
45 sigdelset(&current->pending.signal, SIGKILL);
46+ trace_signal_deliver(SIGKILL, SEND_SIG_NOINFO,
47+ &sighand->action[SIGKILL - 1]);
48 recalc_sigpending();
49 goto fatal;
50 }