Look up another CVE · open CVE-2025-38595 in the interactive tracker
CVE-2025-38595
xen: fix UAF in dmabuf_exp_from_pages()
Published 2025-08-19 (14 months ago) by the Linux kernel CNA. Subsystem drivers/xen. Debian urgency: not yet assigned.
Debian does not build this code. The per-release build detail is under "Where it lives" below.
What to do, per Debian release
Debian's own status for CVE-2025-38595 in every release this site tracks, and what each one means in practice. Every status below is the one the Debian Security Team publishes for this CVE. source
| Release | Status | Version | What this means |
|---|---|---|---|
| Debian 12bookworm | vulnerable | 6.1.190-1 | No fix published anywhere yet, neither in Debian nor upstream for the series bookworm tracks. Watch the Debian tracker page for this CVE. Advisories for bookworm have historically landed a median of 23 days after publication. |
| Debian 13trixie | fixed | 6.12.43-1 | Update the kernel and reboot. Fixed in 6.12.43-1. A running kernel keeps the old code until the machine restarts. |
| Debian 14forky | fixed | 6.16.3-1 | Update the kernel and reboot. Fixed in 6.16.3-1. A running kernel keeps the old code until the machine restarts. |
| Debian unstablesid | fixed | 6.16.3-1 | Update the kernel and reboot. Fixed in 6.16.3-1. A running kernel keeps the old code until the machine restarts. |
The vulnerability
What the bug is
[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.
Where it lives
The fix touches these files. If the subsystem is one you do not use, the practical exposure is lower, though the package is still the vulnerable one.
drivers/xen/gntdev-dmabuf.c
- What this is
- XEN HYPERVISOR INTERFACEMAINTAINERS section matched on drivers/xen/ · xen-devel@lists.xenproject.org · Supported
- Kernel module
- none to look for. The file would have gone into xen_gntdev, and Debian does not compile it into that module, so finding xen_gntdev in lsmod would say nothing about this CVE.
Check it on the machine
grep -wE 'CONFIG_XEN|CONFIG_XEN_GNTDEV|CONFIG_XEN_GNTDEV_DMABUF' /boot/config-$(uname -r)Reads the booted kernel's own configuration, on the machine and nowhere else. =y is built in, =m is a module, and an is not set line means the code is not there.
Show whether Debian builds this, per release
Debian does not build this code. In 4 releases below, every kernel flavour Debian publishes has the switch off, so the vulnerable file is compiled into no kernel binary Debian ships.
- bookworm, trixie, forky, sidn
- n
- not enabled on any flavour - this release does not build the code
- Build switches
- CONFIG_XEN, CONFIG_XEN_GNTDEV, CONFIG_XEN_GNTDEV_DMABUF
- Reads as
- all on means the file is compiled; any one off means it is not.
From the configuration Debian publishes for every kernel flavour it builds. It covers only the architectures Debian ships a linux-config package for, and nothing about a kernel you built yourself. Debian's own status above stays authoritative about the source package.MAINTAINERS kbuild Makefiles Debian linux-config packages
Signals
- Published
- 2025-08-19 (14 months ago)source
- CVSS
- 7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:Hsource recompute it - Attack vector
- local (AV:L)source
- EPSS
- 0.17%, higher than 5.9% of all CVEssource
- CISA KEV
- not listedthe KEV catalogue
- Debian urgency
- not yet assignedsource
- Subsystem
- drivers/xen
Upstream fixes
The versions the CNA records as introducing and fixing this, and the commit for each. source
| Introduced | Fixed in | Commit |
|---|---|---|
| 4.19 | 6.12.42 | e59078852604 |
| 4.19 | 6.15.10 | 3edfd2353f30 |
| 4.19 | 6.16.1 | d59d49af4aee |
| 4.19 | 6.17 | 532c8b51b3a8 |
Why the CNA scored it this way
Quoted from the kernel CNA's own scoring file, word for word. A highlighted metric carries the most severe value CVSS v3.1 defines for it, which is what pushes the score up. source
- AV:LAttack vector, local
- The vulnerability is reached through `IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS` on the local `/dev/xen/gntdev` misc device, requiring local access to the machine (dom0 or a HVM/PVH guest). No network-facing path reaches `dmabuf_exp_from_pages()`.
- AC:LAttack complexity, low
- The attacker controls both sides of the race — one thread issues the export ioctl while another closes the freshly installed fd, whose number is deterministic (lowest free descriptor) — and the window spans a sleepable `mutex_lock()`, making it wide; the ioctl can be retried indefinitely until it wins.
- PR:LPrivileges required, low
- `gntdev_ioctl()` contains no `capable()` or `CAP_*` checks at all, so any user able to open `/dev/xen/gntdev` can trigger it; Xen stacks that use this exact dma-buf path (automotive display virtualization, Qubes vchan) grant unprivileged users access to that node.
- UI:NUser interaction, none
- Exploitation is entirely self-contained within the attacker's own multi-threaded process issuing an ioctl and a concurrent `close()`; no victim action is required.
- S:UScope, unchanged
- The freed objects (`struct gntdev_dmabuf`, the gntdev `struct file`) and the resulting corruption all live in the same kernel's memory as the attacker's own domain; nothing crosses the hypervisor or IOMMU boundary.
- C:HConfidentiality impact, high
- `get_file(gntdev_dmabuf->priv->filp)` reads a pointer out of freed, attacker-groomable `kmalloc-96` memory, and `list_add()` writes kernel heap pointers into that freed slot which can be read back via a resprayed object, yielding kernel memory disclosure; the resulting `struct file` UAF permits arbitrary kernel read.
- I:HIntegrity impact, high
- The unmatched `fput()` on `priv->filp` underflows the gntdev file refcount and frees a `struct file` still referenced by an open fd, and the code writes into the freed `gntdev_dmabuf` (`->fd = ret`, `list_add`) — a classic UAF/DirtyCred-style write primitive leading to control-flow hijack and privilege escalation.
- A:HAvailability impact, high
- Losing the race before `list_add()` makes `dmabuf_exp_release()` run `list_del()` on a zeroed `list_head`, causing a NULL-pointer write oops (or a corruption WARN plus heap/list corruption), and the general UAF and file refcount underflow readily panic the kernel.