lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 16 Dec 2008 11:09:38 +0100
From:	Hendrik Brueckner <brueckner@...ux.vnet.ibm.com>
To:	Andreas Schwab <schwab@...e.de>
Cc:	Hendrik Brueckner <brueckner@...ux.vnet.ibm.com>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Paul Mackerras <paulus@...ba.org>,
	Linux PPC devel <linuxppc-dev@...abs.org>,
	Jeremy Fitzhardinge <jeremy@...p.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	"Ryan S. Arnold" <rsa@...ibm.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Christian Borntraeger <borntraeger@...ibm.com>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	Martin Schwidefsky <schwidefsky@...ibm.com>
Subject: Re: [patch 1/1 v2] hvc_console: escape magic sysrq key

Hello Andreas,

thanks for your comments.

On Tue, Dec 16, 2008 at 10:36:55AM +0100, Andreas Schwab wrote:
> > +					/* if ^0 is pressed again, reset
> > +					 * sysrq_pressed and flip ^0 char */
> The comment says ^0 twice when ^O is meant.
Correct. I have updated the comment.

> > +					sysrq_pressed = (sysrq_pressed) ? 0 : 1;
>                                         sysrq_pressed = !sysrc_pressed;
Ok, it might look better.


[PATCH v2] hvc_console: escape magic sysrq key

From: Hendrik Brueckner <brueckner@...ux.vnet.ibm.com>

The ctrl-o (^O) is a common control key used by several applications like vim.

To allow users to send ^O to the terminal, this patch introduces a check
if ^O is pressed again if the sysrq_pressed variable is already set.
In this case, clear sysrq_pressed state and flip the ^O character to the tty.
(The old behavior has always set "sysrq_pressed" if ^O has been entered, and it
has not flipped the ^O character to the tty.)

Signed-off-by: Hendrik Brueckner <brueckner@...ux.vnet.ibm.com>
---
 drivers/char/hvc_console.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -642,8 +642,11 @@ int hvc_poll(struct hvc_struct *hp)
 				/* Handle the SysRq Hack */
 				/* XXX should support a sequence */
 				if (buf[i] == '\x0f') {	/* ^O */
-					sysrq_pressed = 1;
-					continue;
+					/* if ^O is pressed again, reset
+					 * sysrq_pressed and flip ^O char */
+					sysrq_pressed = !sysrq_pressed;
+					if (sysrq_pressed)
+						continue;
 				} else if (sysrq_pressed) {
 					handle_sysrq(buf[i], tty);
 					sysrq_pressed = 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ