freebsd-dev/sys/dev/uart
Mark Johnston 4a9a41650c uart: Fix an out-of-bounds read in ns8250_bus_probe()
The problem is that ns8250_bus_probe() accesses a field from the
ns8250_softc, which embeds the generic UART softc, but the ns8250_softc
hasn't yet been allocated because we're still probing.

This is a regression from commit 0aefb0a63c.  This fixed a problem
where one of the upper four IER bits, which are usually reserved, needs
to be set in order to get RX interrupts before the RX FIFO is full.  At
the same time, we avoid clearing those reserved bits (see commit
58957d8717, though other UART drivers I looked at do not bother with
this).

So, copy what ns8250_init() does to disable interrupts, since we don't
know what the "right" mask is at this point.

Reported by:	syzbot+f256beefd0df9eb796e7@syzkaller.appspotmail.com
Reviewed by:	imp
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31124
2021-07-13 17:49:39 -04:00
..
uart_bus_acpi.c
uart_bus_fdt.c uart: allow UART_DEV_DBGPORT for fdt consoles 2020-12-02 21:01:52 +00:00
uart_bus_isa.c
uart_bus_pci.c Add support for Gemini Lake LPSS UARTs. 2021-05-23 20:46:32 +03:00
uart_bus_puc.c
uart_bus_scc.c scc(4)/uart(4): Remove obsolete support for Siemens SAB 82532 2020-12-26 13:48:06 +01:00
uart_bus.h
uart_core.c
uart_cpu_acpi.c
uart_cpu_acpi.h
uart_cpu_arm64.c uart: allow UART_DEV_DBGPORT for fdt consoles 2020-12-02 21:01:52 +00:00
uart_cpu_fdt.c uart: allow UART_DEV_DBGPORT for fdt consoles 2020-12-02 21:01:52 +00:00
uart_cpu_fdt.h uart: allow UART_DEV_DBGPORT for fdt consoles 2020-12-02 21:01:52 +00:00
uart_cpu_powerpc.c
uart_cpu_x86.c
uart_cpu.h
uart_dbg.c
uart_dev_imx.c
uart_dev_imx.h
uart_dev_lowrisc.c
uart_dev_lowrisc.h
uart_dev_msm.c
uart_dev_msm.h
uart_dev_mu.c
uart_dev_mvebu.c
uart_dev_ns8250.c uart: Fix an out-of-bounds read in ns8250_bus_probe() 2021-07-13 17:49:39 -04:00
uart_dev_ns8250.h
uart_dev_pl011.c
uart_dev_quicc.c
uart_dev_snps.c
uart_dev_ti8250.c
uart_dev_z8530.c
uart_if.m
uart_ppstypes.h
uart_subr.c uart: Improve console specification parsing 2021-01-14 17:47:04 -07:00
uart_tty.c
uart.h scc(4)/uart(4): Remove obsolete support for Siemens SAB 82532 2020-12-26 13:48:06 +01:00