Skip to content
Heist/ feed
Unrated

dma-buf: dma-heap: don't publish fd before copy_to_user() succeeds

Type: advisorySource: Official CVE List1 source record

In the Linux kernel, the following vulnerability has been resolved: dma-buf: dma-heap: don't publish fd before copy_to_user() succeeds DMA_HEAP_IOCTL_ALLOC allocates a dma-buf and installs an fd into the caller's fd table via dma_buf_fd() -> fd_install() before dma_heap_ioctl() copies the result back to userspace. If the trailing copy_to_user() fails, userspace never learns the fd number, but the fd (and the underlying dma-buf reference) are already visible to other threads in the same process and are leaked for the lifetime of the process. The obvious "close it on the failure path" fix is unsafe: once fd_install() has run, another thread can already dup() the fd, send it via SCM_RIGHTS, or close() it and let its number be reused, so a subsequent close_fd() from the ioctl path can operate on an unrelated file. This was pointed out by Christian König on v1 [1]. Restructure the allocation path so that fd_install() is the last, unfailable step of a successful ioctl: 1. heap->ops->allocate() creates the dma_buf. 2. get_unused_fd_flags() reserves an fd number in the caller's fd table without publishing it, so no other thread can observe it. 3. copy_to_user() delivers the fd number to userspace; on failure the fd is returned with put_unused_fd() and the dma_buf reference is dropped with dma_buf_put(), leaving no user- visible state behind. 4. dma_buf_fd_install() publishes the fd and emits the trace_dma_buf_fd tracepoint -- from here on the ioctl cannot fail. A new dma_buf_fd_insta

Announced Source revision 1
Original source ↗

CVE-2026-89996

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: cve:CVE-2026-89996

Linux

Source reference: /containers/cna/affected/0/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Linux

Source reference: /containers/cna/affected/1/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "vendor": "Linux",
    "product": "Linux",
    "versions": [
      {
        "status": "affected",
        "version": "c02a81fba74fe3488ad6b08bfb5a1329005418f8",
        "lessThan": "ad61defb3e66ac0c598ad6f39b57f15784543d46",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "c02a81fba74fe3488ad6b08bfb5a1329005418f8",
        "lessThan": "1bf6083a41f810d760c4dcd1b80c5194a92575aa",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "c02a81fba74fe3488ad6b08bfb5a1329005418f8",
        "lessThan": "69d57dbadb27ffd5eef34fd184bab145500cdabc",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "c02a81fba74fe3488ad6b08bfb5a1329005418f8",
        "lessThan": "0d4a5d218055db29b50cc07d3d73d27007c2a391",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "c02a81fba74fe3488ad6b08bfb5a1329005418f8",
        "lessThan": "30d0aff2c65a277135cfd8ea28fa1ee75e0ea4e0",
        "versionType": "git"
      }
    ],
    "programFiles": [
      "drivers/dma-buf/dma-buf.c",
      "drivers/dma-buf/dma-heap.c",
      "include/linux/dma-buf.h"
    ],
    "defaultStatus": "unaffected"
  },
  {
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "vendor": "Linux",
    "product": "Linux",
    "versions": [
      {
        "status": "affected",
        "version": "5.6"
      },
      {
        "status": "unaffected",
        "version": "0",
        "lessThan": "5.6",
        "versionType": "semver"
      },
      {
        "status": "unaffected",
        "version": "6.6.160",
        "versionType": "semver",
        "lessThanOrEqual": "6.6.*"
      },
      {
        "status": "unaffected",
        "version": "6.12.112",
        "versionType": "semver",
        "lessThanOrEqual": "6.12.*"
      },
      {
        "status": "unaffected",
        "version": "6.18.52",
        "versionType": "semver",
        "lessThanOrEqual": "6.18.*"
      },
      {
        "status": "unaffected",
        "version": "7.2.5",
        "versionType": "semver",
        "lessThanOrEqual": "7.2.*"
      },
      {
        "status": "unaffected",
        "version": "7.3",
        "versionType": "original_commit_for_fix",
        "lessThanOrEqual": "*"
      }
    ],
    "programFiles": [
      "drivers/dma-buf/dma-buf.c",
      "drivers/dma-buf/dma-heap.c",
      "include/linux/dma-buf.h"
    ],
    "defaultStatus": "affected"
  }
]
Related CVEs
CVE-2026-89996

Source reference: /cveMetadata/cveId

Publisher severity

No explicit severity was provided.

Event
#48577 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement