accel/amdxdna: Fix use-after-free in amdxdna_gem_dmabuf_mmap()
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 |
|
|
6.18.407.1.57.2In the Linux kernel, the following vulnerability has been resolved:
accel/amdxdna: Fix use-after-free in amdxdna_gem_dmabuf_mmap()
When vm_insert_pages() fails, the error path calls vma->vm_ops->close(vma) which internally calls drm_gem_vm_close() → drm_gem_object_put(), releasing the GEM object reference acquired at the start of the function. However, the close_vma label then falls through to put_obj, which calls drm_gem_object_put() a second time on the same object.
If the first put releases the last reference, the object is freed and the second put accesses freed memory, causing a use-after-free.
Fix by returning directly from close_vma instead of falling through to put_obj, since the close handler already performs all necessary cleanup including the object put.
From the CVE record · Linux
The Linux kernel's amdxdna GEM DMA-BUF mmap error path can release the same object twice when vm_insert_pages() fails. If the first release frees the object, the second accesses freed memory, causing a use-after-free. The input does not specify attacker access or user-interaction requirements.
Engineers running Linux kernels with the amdxdna driver should check whether their kernel includes the fix; affected versions are not specified.