Files
linux/drivers/tty
Dmitry Safonov 835cdc67d6 tty: Don't hold ldisc lock in tty_reopen() if ldisc present
commit d3736d82e8 upstream.

Try to get reference for ldisc during tty_reopen().
If ldisc present, we don't need to do tty_ldisc_reinit() and lock the
write side for line discipline semaphore.
Effectively, it optimizes fast-path for tty_reopen(), but more
importantly it won't interrupt ongoing IO on the tty as no ldisc change
is needed.
Fixes user-visible issue when tty_reopen() interrupted login process for
user with a long password, observed and reported by Lukas.

Fixes: c96cf923a9 ("tty: Don't block on IO when ldisc change is pending")
Fixes: 83d817f410 ("tty: Hold tty_ldisc_lock() during tty_reopen()")
Cc: Jiri Slaby <jslaby@suse.com>
Reported-by: Lukas F. Hartmann <lukas@mntmn.com>
Tested-by: Lukas F. Hartmann <lukas@mntmn.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-15 11:01:10 +09:00
..
2023-05-15 10:54:35 +09:00
2011-03-31 11:26:23 -03:00
2023-05-15 09:59:16 +09:00
2018-05-09 21:14:17 -07:00
2016-03-07 16:11:14 -08:00
2023-05-15 09:59:14 +09:00
2016-02-14 14:36:04 -08:00