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