]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
Fix OpenSSH pty regression on close
authorBrian Bloniarz <brian.bloniarz@gmail.com>
Sun, 6 Mar 2016 21:16:30 +0000 (13:16 -0800)
committerKamal Mostafa <kamal@canonical.com>
Fri, 10 Jun 2016 13:32:25 +0000 (06:32 -0700)
commitbb1fe2fd2abe63efca69bc21143ddd9e8f698665
tree6c95a80a7f2c5f9af1170b6c12051ae468158315
parent76fb25c1664f48583097ac9a5307d3f8c3791e41
Fix OpenSSH pty regression on close

BugLink: http://bugs.launchpad.net/bugs/1588945
commit 0f40fbbcc34e093255a2b2d70b6b0fb48c3f39aa upstream.

OpenSSH expects the (non-blocking) read() of pty master to return
EAGAIN only if it has received all of the slave-side output after
it has received SIGCHLD. This used to work on pre-3.12 kernels.

This fix effectively forces non-blocking read() and poll() to
block for parallel i/o to complete for all ttys. It also unwinds
these changes:

1) f8747d4a466ab2cafe56112c51b3379f9fdb7a12
   tty: Fix pty master read() after slave closes

2) 52bce7f8d4fc633c9a9d0646eef58ba6ae9a3b73
   pty, n_tty: Simplify input processing on final close

3) 1a48632ffed61352a7810ce089dc5a8bcd505a60
   pty: Fix input race when closing

Inspired by analysis and patch from Marc Aurele La France <tsi@tuyoix.net>

Reported-by: Volth <openssh@volth.com>
Reported-by: Marc Aurele La France <tsi@tuyoix.net>
BugLink: https://bugzilla.mindrot.org/show_bug.cgi?id=52
BugLink: https://bugzilla.mindrot.org/show_bug.cgi?id=2492
Signed-off-by: Brian Bloniarz <brian.bloniarz@gmail.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Documentation/serial/tty.txt
drivers/tty/n_hdlc.c
drivers/tty/n_tty.c
drivers/tty/pty.c
drivers/tty/tty_buffer.c
include/linux/tty.h