drm/nouveau/dmem: fix mismatched DMA unmap size for large folios
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/nouveau/dmem: fix mismatched DMA unmap size for large folios
Device-private THP migration maps migration buffers with page_size() and records that length in dma_info->size. For a compound folio page_size() is PAGE_SIZE << order, but two teardown sites still pass a literal PAGE_SIZE to dma_unmap_page():
- nouveau_dmem_migrate_to_ram() on the success path, and - nouveau_dmem_migrate_copy_one() on the copy-error path.
For an order > 0 folio this unmaps less than was mapped, leaking the remainder of the IOMMU/IOVA mapping. The other unmap sites, in nouveau_dmem_migrate_chunk() and nouveau_dmem_evict_chunk(), already use the saved size; use it here too.
From the CVE record · Linux
The Linux kernel’s Nouveau driver uses the wrong DMA unmap size at two device-private memory migration teardown sites. When migrating a compound folio of order greater than zero, this can leave part of an IOMMU/IOVA mapping allocated. The input does not establish an attacker path, authentication requirements, or user interaction.
Teams running Linux kernels with the Nouveau driver should check whether their kernel includes the fix; affected versions were not specified.