Skip to main content
← All vulnerabilities
CVE-2025-38595

xen: fix UAF in dmabuf_exp_from_pages()

Affects Linux kernel builds with the Xen gntdev dma-buf export code path, from 4.19.0 up to the fixed releases 6.6.160, 6.12.42, 6.15.10 and 6.16.1 on their branches.

Published
Last modified
published
Not listed in CISA KEV
Specific setups only
Fix
Fixed in 6.6.160, 6.12.42, 6.15.10, 6.16.1
None on Exploit-DB, Metasploit or GitHub

Summary

In the Linux kernel, the following vulnerability has been resolved: xen: fix UAF in dmabuf_exp_from_pages() [dma_buf_fd() fixes; no preferences regarding the tree it goes through - up to xen folks] As soon as we'd inserted a file reference into descriptor table, another thread could close it. That's fine for the case when all we are doing is returning that descriptor to userland (it's a race, but it's a userland race and there's nothing the kernel can do about it). However, if we follow fd_install() with any kind of access to objects that would be destroyed on close (be it the struct file itself or anything destroyed by its ->release()), we have a UAF. dma_buf_fd() is a combination of reserving a descriptor and fd_install(). gntdev dmabuf_exp_from_pages() calls it and then proceeds to access the objects destroyed on close - starting with gntdev_dmabuf itself. Fix that by doing reserving descriptor before anything else and do fd_install() only when everything had been set up.

Timeline

  1. CVE published
  2. Record last updated

Affected versions

  • Linux Linux

    Version range not reported

  • Linux Linux

    4.19

  • KernelLinux

    From 4.19.0 · fixed in 6.6.160; From 6.7.0 · fixed in 6.12.42; From 6.13.0 · fixed in 6.15.10; From 6.16.0 · fixed in 6.16.1

References 6

git.kernel.org

FAQ

Questions about CVE-2025-38595

What does this mean?

After a file descriptor is installed, another thread can close it and destroy objects such as gntdev_dmabuf that the kernel still uses. This use-after-free can corrupt kernel memory.Source: git.kernel.org

Am I affected, and how do I check?

The bug is in the Xen gntdev dma-buf export code (dmabuf_exp_from_pages in drivers/xen/gntdev-dmabuf.c). The listed Linux kernel ranges are 4.19.0 to before 6.6.160, 6.7.0 to before 6.12.42, 6.13.0 to before 6.15.10, and 6.16.0 only, so check your kernel version with uname -r against those ranges.Source: git.kernel.org

What should I do about it?

Upgrade to the fixed release for your branch: 6.6.160, 6.12.42, 6.15.10, or 6.16.1.Source: git.kernel.org

Is it being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.Source: cve.now feed data