1
0
Files
linux/drivers/tty/serial
Peter Hurley 2e75891083 serial: core: Flush ldisc after dropping port mutex in uart_close()
The tty buffers (and any line discipline buffers) must be flushed after
the UART hardware has shutdown; otherwise, a racing open on the same
tty may receive data from the previous session, which is a security
hazard. However, holding the port mutex while flushing the line
discipline buffers creates a lock inversion if the set_termios()
handler takes the port mutex (as it does in the followup patch,
'serial: Fix locking for uart driver set_termios method'.

Flush the ldisc buffers after dropping the port mutex; the tty lock
is still held which prevents a concurrent open() from advancing while
flushing. Since no new rx data is possible after uart_shutdown() until
a new open reinitializes the port, the later flush has no impact on
what data is being discarded.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 18:53:54 -08:00
..
2014-07-13 15:52:12 -07:00
2014-06-19 13:04:52 -07:00
2014-09-23 21:19:35 -07:00
2014-09-28 21:49:48 -04:00
2013-07-31 17:56:15 -07:00
2014-06-19 13:04:52 -07:00
2013-07-31 17:56:15 -07:00
2014-06-19 13:04:52 -07:00
2014-06-19 13:04:52 -07:00
2014-05-28 12:27:22 -07:00
2014-06-19 13:04:52 -07:00
2014-06-19 13:04:52 -07:00
2014-09-08 16:22:42 -07:00
2014-06-19 13:04:52 -07:00
2014-06-19 13:04:52 -07:00