Skip to content
Heist/ feed
Unrated

udmabuf: fix memory leak on last export_udmabuf() error path

Type: advisorySource: Official CVE List1 source record

In the Linux kernel, the following vulnerability has been resolved: udmabuf: fix memory leak on last export_udmabuf() error path In export_udmabuf(), if dma_buf_fd() fails because the FD table is full, a dma_buf owning the udmabuf has already been created; but the error handling in udmabuf_create() will tear down the udmabuf without doing anything about the containing dma_buf. This leaves a dma_buf in memory that contains a dangling pointer; though that doesn't seem to lead to anything bad except a memory leak. Fix it by moving the dma_buf_fd() call out of export_udmabuf() so that we can give it different error handling. Note that the shape of this code changed a lot in commit 5e72b2b41a21 ("udmabuf: convert udmabuf driver to use folios"); but the memory leak seems to have existed since the introduction of udmabuf.

Announced Source revision 1
Original source ↗

CVE-2024-56712

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-2024-56712

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": "fbb0de795078190a9834b3409e4b009cfb18a6d4",
        "lessThan": "e469922fbdf6ad729e5dc8d49289b5036a0ecdf8",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "fbb0de795078190a9834b3409e4b009cfb18a6d4",
        "lessThan": "c9fc8428d4255c2128da9c4d5cd92e554d0150cf",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "fbb0de795078190a9834b3409e4b009cfb18a6d4",
        "lessThan": "f49856f525acd5bef52ae28b7da2e001bbe7439e",
        "versionType": "git"
      }
    ],
    "programFiles": [
      "drivers/dma-buf/udmabuf.c"
    ],
    "defaultStatus": "unaffected"
  },
  {
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "vendor": "Linux",
    "product": "Linux",
    "versions": [
      {
        "status": "affected",
        "version": "4.20"
      },
      {
        "status": "unaffected",
        "version": "0",
        "lessThan": "4.20",
        "versionType": "semver"
      },
      {
        "status": "unaffected",
        "version": "6.6.160",
        "versionType": "semver",
        "lessThanOrEqual": "6.6.*"
      },
      {
        "status": "unaffected",
        "version": "6.12.7",
        "versionType": "semver",
        "lessThanOrEqual": "6.12.*"
      },
      {
        "status": "unaffected",
        "version": "6.13",
        "versionType": "original_commit_for_fix",
        "lessThanOrEqual": "*"
      }
    ],
    "programFiles": [
      "drivers/dma-buf/udmabuf.c"
    ],
    "defaultStatus": "affected"
  }
]
Related CVEs
CVE-2024-56712

Source reference: /cveMetadata/cveId

Publisher severity

No explicit severity was provided.

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