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

habanalabs: fix UAF in export_dmabuf()

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

Summary

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.

Timeline

  1. CVE published
  2. Record last updated

Affected versions

  • Linux Linux

    Version range not reported

  • Linux Linux

    5.16

  • KernelLinux

    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

References 6

git.kernel.org

FAQ

Questions about CVE-2025-38722

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: git.kernel.org

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: git.kernel.org

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: 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