lkml.org 
[lkml]   [2017]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 09/26] signal: Don't allow sending SIGKILL or SIGSTOP to init
Even to init SIGKILL and SIGSTOP are alwasys delivered if they are
sent, so don't allow tracing an init task allow them.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
kernel/signal.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index 5eff2f9f8c42..627b482fa3f8 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -98,8 +98,12 @@ static int sig_ignored(struct task_struct *t, int sig, bool force)

/*
* Tracers may want to know about even ignored signals.
+ * We can never safely allow SIGKILL or SIGSTOP to
+ * be sent to init from it's children.
*/
- return !t->ptrace;
+ return !t->ptrace ||
+ ((t->signal->flags & SIGNAL_UNKILLABLE) &&
+ sig_kernel_only(sig) && !force);
}

/*
--
2.10.1
\
 
 \ /
  Last update: 2017-06-12 00:53    [W:0.155 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site