CVE-2026-99645: mm/cma: don't release CMA pages still in use
In the Linux kernel, the following vulnerability has been resolved:
mm/cma: don't release CMA pages still in use
When a driver calls dmafreecontiguous() before quiescing DMA, the page might still have a reference from the device. putpagetestzero() there returns false, WARN fires, but the code proceeds to freecontigfrozenrange() putting a live page onto buddy and clearing the bitmap. A subsequent allocation can hand the same PFN to a new owner while the original holder still references it.
A concurrent putpage() that drops the last reference between the testzero loop and freecontigfrozenrange() can double-queue the page via page->lru, corrupting buddy lists.
Avoid the corruption by not freeing a CMA region if any of the pages inside are still in use.
Make it explicit in the warning that the driver allowed a leak.
While at it, use pagereffreeze() to make the semantics clearer and switch to prwarnratelimited().
[ david: use pagereffreeze() + prwarnratelimited() ]
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Compensating control
Do not release a CMA region if any pages inside it are still in use.
Frequently Asked Questions
What conditions are required for this issue to occur?
A driver must call dma_free_contiguous() before DMA using the CMA pages has been quiesced, leaving one or more pages still referenced by the device. The problematic behavior also involves a race in which the final put_page() occurs between the reference check and release of the contiguous range.
Which systems are realistically exposed?
Systems using the Linux kernel CMA allocator are exposed when a driver releases contiguous DMA memory while hardware can still access or retain references to that memory. The issue depends on faulty driver shutdown or DMA teardown ordering rather than ordinary allocation and release alone.
What happens if the affected release path is reached?
Live CMA pages can be returned to the buddy allocator and later allocated to another owner while the original device still references them. The race can also double-queue a page through page->lru, corrupting buddy allocator lists.
What is the mitigation if the kernel fix cannot be applied immediately?
Ensure drivers quiesce DMA and release all device references before calling dma_free_contiguous(). Avoid freeing CMA allocations until the hardware can no longer access the associated pages.
How does the resolved behavior handle pages that are still in use?
The corrected code does not free a CMA region when any page in that region remains in use. It emits a rate-limited warning indicating that the driver allowed a leak, trading the unsafe release for retained memory.