CVE-2026-139685: staging: iio: adc: ad7816: Fix DMA safety issues in SPI transfers
In the Linux kernel, the following vulnerability has been resolved:
staging: iio: adc: ad7816: Fix DMA safety issues in SPI transfers
The SPI operations in this driver are not DMA safe: 1. spiread() uses a stack-allocated buffer. 2. spiwrite() in ad7816spiread() uses a struct member that shares a cacheline with other variables. 3. spiwrite() in ad7816spiwrite() passes a stack parameter by reference.
Fix these violations by replacing all spiread() and spiwrite() calls with spiwritethenread(). This safely handles DMA by internally allocating a bounce buffer for the transfers, avoiding cacheline sharing issues without needing dedicated aligned buffers. This implicitly corrects the size argument in read to sizeof(buf).
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Replace all spi_read() and spi_write() calls in the ad7816 driver with spi_write_then_read() to handle DMA safely.