serial: imx: serialize imx_uart_ports[] lifetime
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ dbff4e9ea2e83fda89143389bfb229cb29425a32 · < 7429dce56a73bc080a8c072edb167106f73a08ae| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
serial: imx: serialize imx_uart_ports[] lifetime
imx_uart_probe() publishes its devm-allocated port in imx_uart_ports[] before uart_add_one_port() because console setup uses the table. The entry is not cleared when adding the port fails or after removal, leaving a dangling pointer.
A sibling probe can register the shared console through that stale entry. This was reproduced under KASAN on QEMU mcimx6ul-evk by unbinding a sibling UART, unbinding the console UART and rebinding the sibling.
Keep the entry valid through uart_remove_one_port(), then clear it. Protect port addition and removal together with their table updates so sibling operations cannot interleave. Reject an occupied slot rather than clobbering an active port during a duplicate-line probe.
From the CVE record · Linux
The Linux kernel’s i.MX UART driver can leave a dangling pointer in its port table after a port-add failure or removal. A sibling UART probe can use that stale entry when registering the shared console; the issue was reproduced by unbinding and rebinding UARTs. The input does not establish whether an attacker can trigger this remotely or what privileges are required.
Engineers running Linux kernels with the i.MX UART driver should check their affected versions against the vendor advisory; no version range was provided.