lkml.org 
[lkml]   [2010]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] tty: prevent SAK to kill init process
Date
hi,

hitting "Secure Attention Key" on console that's openned
by init process, causing panic due to an attempt to kill
the init process.

Fixing this by skipping the init process in the loop.

wbr,
jirka


Signed-off-by: Jiri Olsa <jolsa@redhat.com>
---
drivers/char/tty_io.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index c05c5af..1b85d37 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -2746,6 +2746,8 @@ void __do_SAK(struct tty_struct *tty)
read_lock(&tasklist_lock);
/* Kill the entire session */
do_each_pid_task(session, PIDTYPE_SID, p) {
+ if (is_global_init(p))
+ continue;
printk(KERN_NOTICE "SAK: killed process %d"
" (%s): task_session(p)==tty->session\n",
task_pid_nr(p), p->comm);
@@ -2755,6 +2757,8 @@ void __do_SAK(struct tty_struct *tty)
* tty open.
*/
do_each_thread(g, p) {
+ if (is_global_init(p))
+ continue;
if (p->signal->tty == tty) {
printk(KERN_NOTICE "SAK: killed process %d"
" (%s): task_session(p)==tty->session\n",
--
1.7.1


\
 
 \ /
  Last update: 2010-11-01 19:37    [W:0.620 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site