tty: xilinx_uartps: split sysrq handling
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 74ea66d4ca061a3cd4c0e924e51b60e924644852 · < b06f388994500297bb91be60ffaf6825ecfd2afe| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
tty: xilinx_uartps: split sysrq handling
lockdep detects the following circular locking dependency:
CPU 0 CPU 1 ========================== ============================ cdns_uart_isr() printk() uart_port_lock(port) console_lock() cdns_uart_console_write() if (!port->sysrq) uart_port_lock(port) uart_handle_break() port->sysrq = ... uart_handle_sysrq_char() printk() console_lock()
The fixed commit attempts to avoid this situation by only taking the port lock in cdns_uart_console_write if port->sysrq unset. However, if (as shown above) cdns_uart_console_write runs before port->sysrq is set, then it will try to take the port lock anyway. This may result in a deadlock.
Fix this by splitting sysrq handling into two parts. We use the prepare helper under the port lock and defer handling until we release the lock.
From the CVE record · Linux
The Linux kernel’s xilinx_uartps tty driver has a circular locking dependency between SysRq handling and console output. Concurrent execution of the interrupt handler and console output can cause a deadlock; the input does not specify attacker access requirements or user interaction.
Engineers running Linux kernels with the xilinx_uartps tty driver should check their exposure; affected versions are not specified.