From: Jiri Olsa <jolsa@redhat.com>
To: ebiederm@xmission.com, gregkh@suse.de
Cc: linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@redhat.com>
Subject: [PATCH] tty: prevent SAK to kill init process
Date: Mon, 1 Nov 2010 19:34:26 +0100 [thread overview]
Message-ID: <1288636466-9775-1-git-send-email-jolsa@redhat.com> (raw)
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
next reply other threads:[~2010-11-01 18:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-01 18:34 Jiri Olsa [this message]
2010-11-01 19:40 ` Eric W. Biederman
2010-11-02 8:55 ` Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1288636466-9775-1-git-send-email-jolsa@redhat.com \
--to=jolsa@redhat.com \
--cc=ebiederm@xmission.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome