]> www.infradead.org Git - users/jedix/linux-maple.git/commit
n_tty: signal and flush atomically
authorPeter Hurley <peter@hurleysoftware.com>
Sat, 27 Jun 2015 13:21:32 +0000 (09:21 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Aug 2015 19:21:57 +0000 (12:21 -0700)
commitba3961ad681981dc74fcd519b8f98be8bc3ac381
treea2a94cb95dec4e7df68a555d0cd2e4c5a13959e3
parentf3ef6ad3e4501dae41b0015a3bd8e179b56bdfd8
n_tty: signal and flush atomically

commit 3b19e032295647b7be2aa3be62510db4aaeda759 upstream.

When handling signalling char, claim the termios write lock before
signalling waiting readers and writers to prevent further i/o
before flushing the echo and output buffers. This prevents a
userspace signal handler which may output from racing the terminal
flush.

Reference: Bugzilla #99351 ("Output truncated in ssh session after...")
Fixes: commit d2b6f44779d3 ("n_tty: Fix signal handling flushes")
Reported-by: Filipe Brandenburger <filbranden@google.com>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c