twx-linux/drivers/tty
Ryo Takakura 3b377f805e serial: sifive: lock port in startup()/shutdown() callbacks
commit e1ca3ff28ab1e2c1e70713ef3fa7943c725742c3 upstream.

startup()/shutdown() callbacks access SIFIVE_SERIAL_IE_OFFS.
The register is also accessed from write() callback.

If console were printing and startup()/shutdown() callback
gets called, its access to the register could be overwritten.

Add port->lock to startup()/shutdown() callbacks to make sure
their access to SIFIVE_SERIAL_IE_OFFS is synchronized against
write() callback.

Fixes: 45c054d0815b ("tty: serial: add driver for the SiFive UART")
Signed-off-by: Ryo Takakura <ryotkkr98@gmail.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: John Ogness <john.ogness@linutronix.de>
Rule: add
Link: https://lore.kernel.org/stable/20250330003522.386632-1-ryotkkr98%40gmail.com
Link: https://lore.kernel.org/r/20250412001847.183221-1-ryotkkr98@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-05-02 07:50:49 +02:00
..
hvc
ipwireless
serdev
serial serial: sifive: lock port in startup()/shutdown() callbacks 2025-05-02 07:50:49 +02:00
vt
amiserial.c
ehv_bytechan.c
goldfish.c
Kconfig
Makefile
mips_ejtag_fdc.c
moxa.c
mxser.c
n_gsm.c tty: n_gsm: Fix use-after-free in gsm_cleanup_mux 2024-10-22 15:46:34 +02:00
n_hdlc.c
n_null.c
n_tty.c tty: n_tty: use uint for space returned by tty_write_room() 2025-04-10 14:37:34 +02:00
nozomi.c
pty.c
rpmsg_tty.c
synclink_gt.c
sysrq.c of: remove internal arguments from of_property_for_each_u32() 2025-02-08 09:51:51 +01:00
tty_audit.c
tty_baudrate.c
tty_buffer.c
tty_io.c tty: ldsic: fix tty_ldisc_autoload sysctl's proc_handler 2024-12-09 10:32:45 +01:00
tty_ioctl.c
tty_jobctrl.c
tty_ldisc.c
tty_ldsem.c
tty_mutex.c
tty_port.c
tty.h
ttynull.c
vcc.c