CVE-2025-40172
Description
In the Linux kernel, the following vulnerability has been resolved:
accel/qaic: Treat remaining == 0 as error in find_and_map_user_pages()
Currently, if find_and_map_user_pages() takes a DMA xfer request from the user with a length field set to 0, or in a rare case, the host receives QAIC_TRANS_DMA_XFER_CONT from the device where resources->xferred_dma_size is equal to the requested transaction size, the function will return 0 before allocating an sgt or setting the fields of the dma_xfer struct. In that case, encode_addr_size_pairs() will try to access the sgt which will lead to a general protection fault.
Return an EINVAL in case the user provides a zero-sized ALP, or the device requests continuation after all of the bytes have been transferred.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A zero-length DMA transfer request in the Linux kernel's QAIC accelerator driver causes a general protection fault when accessing an unallocated scatter-gather table.
Root
Cause
In the Linux kernel's accel/qaic driver, the find_and_map_user_pages() function returns 0 without allocating a scatter-gather table (sgt) or populating the dma_xfer struct when it encounters a DMA transfer request with a length of 0. This can happen if a user submits a zero-sized address-length pair (ALP) or if the device sends a continuation request after all bytes have already been transferred (where resources->xferred_dma_size equals the requested size) [description].
Exploitation
An attacker with the ability to submit DMA xfer requests to the QAIC driver — either from userspace (by providing a zero-length field) or via crafted device commands — can trigger this code path. No special privileges beyond the ability to interact with the QAIC device are required; the flaw is reachable without authentication if the device is accessible [description].
Impact
When find_and_map_user_pages() returns 0 early, the subsequent sgt field remains uninitialized. The subsequent call to encode_addr_size_pairs() dereferences this pointer, leading to a general protection fault (GPF). This GPF can crash the kernel, causing a denial of service for service for the entire system [description].
Mitigation
The fix, already committed to the stable kernel tree, changes the behavior to return -EINVAL when the remaining transfer size is zero, preventing the invalid memory access [1][2]. Users are advised to apply the latest stable kernel updates that include this patch.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2Patches
448b1d42286bf551f1dfbcb7f1ab9733d14cc11f08c30a3e4Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
4News mentions
0No linked articles in our index yet.