spi: bcm2835: bcm2835_spi_handle_err(): fix NULL pointer deref for non DMA transfers
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
spi: bcm2835: bcm2835_spi_handle_err(): fix NULL pointer deref for non DMA transfers
In case a IRQ based transfer times out the bcm2835_spi_handle_err() function is called. Since commit 1513ceee70f2 ("spi: bcm2835: Drop dma_pending flag") the TX and RX DMA transfers are unconditionally canceled, leading to NULL pointer derefs if ctlr->dma_tx or ctlr->dma_rx are not set.
Fix the NULL pointer deref by checking that ctlr->dma_tx and ctlr->dma_rx are valid pointers before accessing them.
From the CVE record · Linux
The Linux kernel's bcm2835 SPI error handler can dereference a NULL pointer when an IRQ-based, non-DMA transfer times out. The handler attempts to cancel DMA transfers even when their pointers are unset, potentially causing a crash. The input does not specify whether an attacker can trigger the timeout or what access would be needed.
Engineers running the Linux kernel with the bcm2835 SPI driver should check their installations; affected versions are not specified.