serial: 8250: Fix TX deadlock when using DMA
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 9e512eaaf8f4008c44ede3dfc0fbc9d9c5118583 · < 5f6b17562f03fc65c7d3474ef8f1959b19d1ca41| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
serial: 8250: Fix TX deadlock when using DMA
`dmaengine_terminate_async` does not guarantee that the `__dma_tx_complete` callback will run. The callback is currently the only place where `dma->tx_running` gets cleared. If the transaction is canceled and the callback never runs, then `dma->tx_running` will never get cleared and we will never schedule new TX DMA transactions again.
This change makes it so we clear `dma->tx_running` after we terminate the DMA transaction. This is "safe" because `serial8250_tx_dma_flush` is holding the UART port lock. The first thing the callback does is also grab the UART port lock, so access to `dma->tx_running` is serialized.
From the CVE record · Linux
The Linux kernel’s 8250 serial driver can stop scheduling transmit DMA transactions if a canceled transaction’s completion callback does not run. The description does not identify an attacker or specify access or user-interaction requirements.
Engineers running Linux kernels that use the 8250 serial driver with DMA should check their systems; affected versions are not specified.