Re: [PATCH v3] Fix OpenSSH pty regression on close

From: Peter Hurley
Date: Mon Apr 04 2016 - 23:43:16 EST


On 03/06/2016 01:16 PM, Brian Bloniarz wrote:
> 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

Reviewed-by: Peter Hurley <peter@xxxxxxxxxxxxxxxxxx>