* Patch "n_tty: Fix unsafe reference to "other" ldisc" has been added to the 4.3-stable tree
@ 2016-02-14 20:27 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-02-14 20:27 UTC (permalink / raw)
To: peter, gregkh; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
n_tty: Fix unsafe reference to "other" ldisc
to the 4.3-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
n_tty-fix-unsafe-reference-to-other-ldisc.patch
and it can be found in the queue-4.3 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 6d27a63caad3f13e96cf065d2d96828c2006be6b Mon Sep 17 00:00:00 2001
From: Peter Hurley <peter@hurleysoftware.com>
Date: Sun, 10 Jan 2016 22:40:56 -0800
Subject: n_tty: Fix unsafe reference to "other" ldisc
From: Peter Hurley <peter@hurleysoftware.com>
commit 6d27a63caad3f13e96cf065d2d96828c2006be6b upstream.
Although n_tty_check_unthrottle() has a valid ldisc reference (since
the tty core gets the ldisc ref in tty_read() before calling the line
discipline read() method), it does not have a valid ldisc reference to
the "other" pty of a pty pair. Since getting an ldisc reference for
tty->link essentially open-codes tty_wakeup(), just replace with the
equivalent tty_wakeup().
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/n_tty.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -258,16 +258,13 @@ static void n_tty_check_throttle(struct
static void n_tty_check_unthrottle(struct tty_struct *tty)
{
- if (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
- tty->link->ldisc->ops->write_wakeup == n_tty_write_wakeup) {
+ if (tty->driver->type == TTY_DRIVER_TYPE_PTY) {
if (chars_in_buffer(tty) > TTY_THRESHOLD_UNTHROTTLE)
return;
if (!tty->count)
return;
n_tty_kick_worker(tty);
- n_tty_write_wakeup(tty->link);
- if (waitqueue_active(&tty->link->write_wait))
- wake_up_interruptible_poll(&tty->link->write_wait, POLLOUT);
+ tty_wakeup(tty->link);
return;
}
Patches currently in stable-queue which might be from peter@hurleysoftware.com are
queue-4.3/n_tty-fix-unsafe-reference-to-other-ldisc.patch
queue-4.3/tty-fix-unsafe-ldisc-reference-via-ioctl-tiocgetd.patch
queue-4.3/n_tty-fix-poll-after-buffer-limited-eof-push-read.patch
queue-4.3/tty-fix-gpf-in-flush_to_ldisc.patch
queue-4.3/tty-retry-failed-reopen-if-tty-teardown-in-progress.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-02-14 20:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-14 20:27 Patch "n_tty: Fix unsafe reference to "other" ldisc" has been added to the 4.3-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox