kernel_optimize_test/drivers/tty
daniel.starke@siemens.com bb2e0a7723 tty: n_gsm: fix deadlock in gsmtty_open()
commit a2ab75b8e76e455af7867e3835fd9cdf386b508f upstream.

In the current implementation the user may open a virtual tty which then
could fail to establish the underlying DLCI. The function gsmtty_open()
gets stuck in tty_port_block_til_ready() while waiting for a carrier rise.
This happens if the remote side fails to acknowledge the link establishment
request in time or completely. At some point gsm_dlci_close() is called
to abort the link establishment attempt. The function tries to inform the
associated virtual tty by performing a hangup. But the blocking loop within
tty_port_block_til_ready() is not informed about this event.
The patch proposed here fixes this by resetting the initialization state of
the virtual tty to ensure the loop exits and triggering it to make
tty_port_block_til_ready() return.

Fixes: e1eaea46bb ("tty: n_gsm line discipline")
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Starke <daniel.starke@siemens.com>
Link: https://lore.kernel.org/r/20220218073123.2121-7-daniel.starke@siemens.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-02 11:42:57 +01:00
..
hvc xen/console: harden hvc_xen against event channel storms 2021-12-22 09:30:59 +01:00
ipwireless
serdev
serial sc16is7xx: Fix for incorrect data being transmitted 2022-03-02 11:42:53 +01:00
vt vt_ioctl: add array_index_nospec to VT_ACTIVATE 2022-02-16 12:54:27 +01:00
amiserial.c
cyclades.c
ehv_bytechan.c
goldfish.c
isicom.c
Kconfig
Makefile
mips_ejtag_fdc.c
moxa.c
moxa.h
mxser.c
mxser.h
n_gsm.c tty: n_gsm: fix deadlock in gsmtty_open() 2022-03-02 11:42:57 +01:00
n_hdlc.c tty: n_hdlc: make n_hdlc_tty_wakeup() asynchronous 2021-12-22 09:30:56 +01:00
n_null.c
n_r3964.c
n_tracerouter.c
n_tracesink.c
n_tracesink.h
n_tty.c tty: n_tty: do not look ahead for EOL character past the end of the buffer 2022-02-23 12:01:04 +01:00
nozomi.c
pty.c
rocket_int.h
rocket.c
rocket.h
synclink_gt.c tty: synclink_gt: rename a conflicting function name 2021-09-30 10:11:03 +02:00
synclink.c
synclinkmp.c
sysrq.c
tty_audit.c
tty_baudrate.c
tty_buffer.c tty: tty_buffer: Fix the softlockup issue in flush_to_ldisc 2021-11-26 10:39:10 +01:00
tty_io.c
tty_ioctl.c
tty_jobctrl.c
tty_ldisc.c
tty_ldsem.c
tty_mutex.c
tty_port.c
ttynull.c
vcc.c