kernel-hacking-2024-linux-s.../drivers/tty/serial
Hugo Villeneuve 7d3b793faa serial: sc16is7xx: fix invalid FIFO access with special register set
When enabling access to the special register set, Receiver time-out and
RHR interrupts can happen. In this case, the IRQ handler will try to read
from the FIFO thru the RHR register at address 0x00, but address 0x00 is
mapped to DLL register, resulting in erroneous FIFO reading.

Call graph example:
    sc16is7xx_startup(): entry
    sc16is7xx_ms_proc(): entry
    sc16is7xx_set_termios(): entry
    sc16is7xx_set_baud(): DLH/DLL = $009C --> access special register set
    sc16is7xx_port_irq() entry            --> IIR is 0x0C
    sc16is7xx_handle_rx() entry
    sc16is7xx_fifo_read(): --> unable to access FIFO (RHR) because it is
                               mapped to DLL (LCR=LCR_CONF_MODE_A)
    sc16is7xx_set_baud(): exit --> Restore access to general register set

Fix the problem by claiming the efr_lock mutex when accessing the Special
register set.

Fixes: dfeae619d7 ("serial: sc16is7xx")
Cc: stable@vger.kernel.org
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://lore.kernel.org/r/20240723125302.1305372-3-hugo@hugovil.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-07-31 12:31:19 +02:00
..
8250 TTY/Serial updates for 6.11-rc1 2024-07-19 15:22:14 -07:00
jsm
21285.c
altera_jtaguart.c
altera_uart.c
amba-pl010.c
amba-pl011.c
apbuart.c
apbuart.h
ar933x_uart.c
arc_uart.c
atmel_serial.c
atmel_serial.h
bcm63xx_uart.c serial: bcm63xx-uart: fix tx after conversion to uart_port_tx_limited() 2024-06-24 16:14:48 +02:00
clps711x.c
cpm_uart.c
cpm_uart.h
digicolor-usart.c
dz.c
dz.h
earlycon-riscv-sbi.c
earlycon-semihost.c
earlycon.c
esp32_acm.c tty: add missing MODULE_DESCRIPTION() macros 2024-06-24 16:10:11 +02:00
esp32_uart.c tty: add missing MODULE_DESCRIPTION() macros 2024-06-24 16:10:11 +02:00
fsl_linflexuart.c
fsl_lpuart.c
icom.c
imx.c TTY/Serial updates for 6.11-rc1 2024-07-19 15:22:14 -07:00
imx_earlycon.c
ip22zilog.c
ip22zilog.h
Kconfig serial: sc16is7xx: re-add Kconfig SPI or I2C dependency 2024-06-04 14:10:28 +02:00
kgdb_nmi.c
kgdboc.c
lantiq.c
liteuart.c
lpc32xx_hs.c
ma35d1_serial.c tty: serial: ma35d1: Add a NULL check for of_node 2024-07-03 16:12:06 +02:00
Makefile serial: sc16is7xx: rename Kconfig CONFIG_SERIAL_SC16IS7XX_CORE 2024-06-04 14:10:28 +02:00
max310x.c
max3100.c
mcf.c tty: mcf: MCF54418 has 10 UARTS 2024-06-24 16:13:05 +02:00
men_z135_uart.c
meson_uart.c
milbeaut_usio.c
mpc52xx_uart.c
mps2-uart.c
msm_serial.c
mux.c
mvebu-uart.c
mxs-auart.c
omap-serial.c
owl-uart.c tty: add missing MODULE_DESCRIPTION() macros 2024-06-24 16:10:11 +02:00
pch_uart.c
pic32_uart.c
pmac_zilog.c
pmac_zilog.h
pxa.c
qcom_geni_serial.c serial: qcom-geni: do not kill the machine on fifo underrun 2024-07-04 12:30:30 +02:00
rda-uart.c
rp2.c
sa1100.c
samsung_tty.c
sb1250-duart.c
sc16is7xx.c serial: sc16is7xx: fix invalid FIFO access with special register set 2024-07-31 12:31:19 +02:00
sc16is7xx.h
sc16is7xx_i2c.c
sc16is7xx_spi.c
sccnxp.c
serial-tegra.c
serial_base.h serial: core: Add serial_base_match_and_update_preferred_console() 2024-07-04 15:41:44 +02:00
serial_base_bus.c Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
serial_core.c serial: core: check uartclk for zero to avoid divide by zero 2024-07-31 12:30:06 +02:00
serial_ctrl.c
serial_mctrl_gpio.c tty: add missing MODULE_DESCRIPTION() macros 2024-06-24 16:10:11 +02:00
serial_mctrl_gpio.h
serial_port.c serial: port: Don't block system suspend even if bytes are left to xmit 2024-06-04 14:09:47 +02:00
serial_txx9.c
sh-sci.c serial: sh-sci: Add support for RZ/V2H(P) SoC 2024-06-24 16:09:37 +02:00
sh-sci.h
sifive.c
sprd_serial.c
st-asc.c
stm32-usart.c
stm32-usart.h
suncore.c
sunhv.c
sunplus-uart.c
sunsab.c
sunsab.h
sunsu.c tty: sunsu: Simplify device_node cleanup by using __free 2024-06-04 14:00:16 +02:00
sunzilog.c
sunzilog.h
tegra-tcu.c
timbuart.c
timbuart.h
uartlite.c
ucc_uart.c
vt8500_serial.c
xilinx_uartps.c
zs.c
zs.h