OrangePi_CM5/drivers/tty
Johan Hovold edc5466254 serial: 8250: fix racy uartclk update
commit 211cde4f5817dc88ef7f8f2fa286e57fbf14c8ee upstream.

Commit 868f3ee6e4 ("serial: 8250: Add 8250 port clock update method")
added a hack to support SoCs where the UART reference clock can
change behind the back of the driver but failed to add the proper
locking.

First, make sure to take a reference to the tty struct to avoid
dereferencing a NULL pointer if the clock change races with a hangup.

Second, the termios semaphore must be held during the update to prevent
a racing termios change.

Fixes: 868f3ee6e4 ("serial: 8250: Add 8250 port clock update method")
Fixes: c8dff3aa82 ("serial: 8250: Skip uninitialized TTY port baud rate update")
Cc: stable@vger.kernel.org      # 5.9
Cc: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Tested-by: Serge Semin <fancer.lancer@gmail.com>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20211015111422.1027-2-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-18 14:03:51 +01:00
..
hvc hvsi: don't panic on tty_register_driver failure 2021-09-18 13:40:22 +02:00
ipwireless
…
serdev
…
serial serial: 8250: fix racy uartclk update 2021-11-18 14:03:51 +01:00
vt tty: Fix out-of-bound vmalloc access in imageblit 2021-10-06 15:55:45 +02:00
Kconfig
…
Makefile
…
amiserial.c
…
cyclades.c
…
ehv_bytechan.c
…
goldfish.c
…
isicom.c
…
mips_ejtag_fdc.c
…
moxa.c
…
moxa.h
…
mxser.c
…
mxser.h
…
n_gsm.c
…
n_hdlc.c
…
n_null.c
…
n_r3964.c
…
n_tracerouter.c
…
n_tracesink.c
…
n_tracesink.h
…
n_tty.c
…
nozomi.c tty: nozomi: Fix the error handling path of 'nozomi_card_init()' 2021-07-14 16:56:39 +02:00
pty.c
…
rocket.c
…
rocket.h
…
rocket_int.h
…
synclink.c
…
synclink_gt.c tty: synclink_gt: rename a conflicting function name 2021-09-30 10:11:03 +02:00
synclinkmp.c
…
sysrq.c
…
tty_audit.c
…
tty_baudrate.c
…
tty_buffer.c
…
tty_io.c tty: Fix data race between tiocsti() and flush_to_ldisc() 2021-09-15 09:50:47 +02:00
tty_ioctl.c
…
tty_jobctrl.c
…
tty_ldisc.c
…
tty_ldsem.c
…
tty_mutex.c
…
tty_port.c
…
ttynull.c
…
vcc.c
…