CVE-2026-64303 in Linux
Summary
by MITRE • 07/25/2026
In the Linux kernel, the following vulnerability has been resolved:
spi: fsl-lpspi: terminate the RX channel on TX prepare failure path
When dmaengine_prep_slave_sg() fails for the TX channel, the error path terminates the TX DMA channel but leaves the RX channel running. Since the RX channel was already submitted and issued prior to preparing the TX descriptor, returning -EINVAL causes the SPI core to unmap the DMA buffers while the RX DMA engine continues writing to them, leading to potential memory corruption or use-after-free.
Terminate the RX channel before returning on the TX prepare failure path.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 07/25/2026
The vulnerability exists within the Freescale LPSPI (Low Power Serial Peripheral Interface) driver in the Linux kernel, specifically addressing a critical race condition during DMA channel preparation. This issue manifests when the spi_fsl_lpspi driver attempts to prepare DMA descriptors for both transmit and receive operations, creating a scenario where error handling becomes problematic. The flaw occurs during the transaction setup phase when the driver prepares DMA descriptors using the dmaengine_prep_slave_sg() function for the TX channel.
When the TX channel preparation fails, typically returning -EINVAL due to invalid parameters or resource constraints, the current implementation only terminates the TX DMA channel while leaving the RX channel operational. This asymmetric error handling creates a dangerous state where the RX channel continues executing operations even though the transaction has failed. The RX channel was already submitted and issued before attempting to prepare the TX descriptor, meaning it was actively engaged in data transfer operations. The SPI core's subsequent unmapping of DMA buffers occurs while the RX channel is still writing to memory locations, creating a potential memory corruption scenario.
This vulnerability directly relates to CWE-691, which describes inadequate protection against uncontrolled DMA access, and CWE-476, concerning null pointer dereference conditions that can lead to system instability. The operational impact of this flaw extends beyond simple data corruption, potentially enabling privilege escalation or denial-of-service conditions within the kernel space. Attackers could exploit this weakness by forcing DMA preparation failures during SPI transactions, leading to unpredictable behavior in systems utilizing the affected driver.
The attack pattern aligns with ATT&CK technique T1068, which involves exploiting local privilege escalation through kernel vulnerabilities. Systems running Linux kernels with the fsl-lpspi driver are particularly vulnerable when handling SPI communications with DMA enabled, especially in embedded environments or industrial control systems where such interfaces are common. The vulnerability affects all kernel versions containing the problematic code path without proper error handling synchronization.
The recommended mitigation involves modifying the error handling path to ensure both TX and RX DMA channels are terminated before returning from the TX preparation failure scenario. This requires implementing a proper cleanup sequence that checks for active RX channels and terminates them before proceeding with error propagation. The fix should be implemented through careful synchronization of DMA channel management within the driver's transaction setup functions, ensuring that all associated DMA resources are properly released regardless of which specific channel preparation fails. This approach aligns with standard kernel programming practices for resource management and error recovery in DMA operations.