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-next>] [day] [month] [year] [list]
Message-Id: <1410384499-4982-1-git-send-email-peter@hurleysoftware.com>
Date:	Wed, 10 Sep 2014 17:28:19 -0400
From:	Peter Hurley <peter@...leysoftware.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	Jiri Slaby <jslaby@...e.cz>,
	One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>,
	linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
	Peter Hurley <peter@...leysoftware.com>
Subject: [RFC] tty: Always allow tcflow(TCOON) to unwedge terminal

This patch changes user-space behavior (for the better) but I'm not sure
that it's consequence-free. Also, it might not be enough to unwedge the
terminal if the driver got its own flow control state mangled.

Thoughts?

--- >% ---
Subject: [RFC] tty: Always allow tcflow(TCOON) to unwedge terminal

If terminal flow has been stopped, the terminal can be unwedged
by:
	tcflow(fd, TCOOFF);
	tcflow(fd, TCOON);
This works because tcflow(TCOOFF) ensures that ->flow_stopped is set,
which allows tcflow(TCOON) to override the terminal flow state in
__start_tty().

Instead, allow unwedging with only:
        tcflow(fd, TCOON);
by disregarding the existing ->flow_stopped state.

Signed-off-by: Peter Hurley <peter@...leysoftware.com>
---
 drivers/tty/tty_ioctl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c
index 32cee97..c792088 100644
--- a/drivers/tty/tty_ioctl.c
+++ b/drivers/tty/tty_ioctl.c
@@ -1157,10 +1157,8 @@ int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,
 			break;
 		case TCOON:
 			spin_lock_irq(&tty->flow_lock);
-			if (tty->flow_stopped) {
-				tty->flow_stopped = 0;
-				__start_tty(tty);
-			}
+			tty->flow_stopped = 0;
+			__start_tty(tty);
 			spin_unlock_irq(&tty->flow_lock);
 			break;
 		case TCIOFF:
-- 
2.1.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