From: Jason Wessel <jason.wessel@windriver.com>
To: greg@kroah.com
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
Jason Wessel <jason.wessel@windriver.com>
Subject: [PATCH 2/2] usb_serial: only allow sysrq on a console port
Date: Fri, 29 May 2009 13:34:17 -0500 [thread overview]
Message-ID: <1243622057-17671-3-git-send-email-jason.wessel@windriver.com> (raw)
In-Reply-To: <1243622057-17671-2-git-send-email-jason.wessel@windriver.com>
The only time a sysrq should get processed is if the attached device
is a console. This is intended to protect sysrq execution on a host
connected with a terminal program.
Here is the problem scenario:
host A <-- rs232 link --> host B
Host A is using mincom and a usb pl2303 device to connect to host b
which is a linux system with a usb pl2303 device acting as the serial
console. When host B is rebooted the pl2303 emits random junk
characters on reset. These character sequences contain serial break
signals most of the time and when translated to a sysrq have caused
host A to get random processes killed, reboots or power down.
It is true that in this setup with this patch host B might still have
the same problem as host A if you reboot host A. In most cases host A
is a development host which seldom gets rebooted, and you could turn
off sysrq temporarily on host B if you need to reboot host A.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
drivers/usb/serial/generic.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index df56ed3..4797402 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -529,7 +529,7 @@ void usb_serial_generic_unthrottle(struct tty_struct *tty)
int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch)
{
- if (port->sysrq) {
+ if (port->sysrq && port->console) {
if (ch && time_before(jiffies, port->sysrq)) {
handle_sysrq(ch, tty_port_tty_get(&port->port));
port->sysrq = 0;
--
1.6.3.1.9.g95405b
next prev parent reply other threads:[~2009-05-29 18:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-29 18:34 [PATCH 0/2] more usb sysrq improvements Jason Wessel
2009-05-29 18:34 ` [PATCH 1/2] pl2303 usb_serial: implement sysrq handling on break Jason Wessel
2009-05-29 18:34 ` Jason Wessel [this message]
2009-06-01 13:35 ` [PATCH 2/2] usb_serial: only allow sysrq on a console port Alan Cox
2009-07-05 16:54 ` Robin Getz
2009-07-05 18:17 ` Alan Cox
2009-07-06 4:38 ` Robin Getz
2009-07-06 4:56 ` Mike Frysinger
2009-07-06 5:33 ` Robin Getz
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=1243622057-17671-3-git-send-email-jason.wessel@windriver.com \
--to=jason.wessel@windriver.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@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
all inboxes | Powered by JetHome®