CVE-2024-56712
udmabuf: fix memory leak on last export_udmabuf() error path
Check your servers for CVE-2024-56712
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-56712 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
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.
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality none, integrity none, availability low: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.25%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 17.5% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 17 Apr 2025):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Weakness
- CWE-401 Missing Release of Memory after Effective Lifetime
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from fbb0de795078190a9834b3409e4b009cfb18a6d4, before 00ebdef47994206f60546929a0f6f63285497272 affected from fbb0de795078190a9834b3409e4b009cfb18a6d4, before e469922fbdf6ad729e5dc8d49289b5036a0ecdf8 affected from fbb0de795078190a9834b3409e4b009cfb18a6d4, before c9fc8428d4255c2128da9c4d5cd92e554d0150cf affected from fbb0de795078190a9834b3409e4b009cfb18a6d4, before f49856f525acd5bef52ae28b7da2e001bbe7439e
Other versions: unaffected
|
| Linux |
affected 4.20 unaffected before 4.20 unaffected from 6.1.191 up to and including 6.1.* unaffected from 6.6.160 up to and including 6.6.* unaffected from 6.12.7 up to and including 6.12.* unaffected 6.13 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2024-56712 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2024-56712
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2024-56712
trivy image --scanners vuln IMAGE | grep CVE-2024-56712
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/00ebdef47994206f60546929a0f6f63285497272 git.kernel.org
- https://git.kernel.org/stable/c/e469922fbdf6ad729e5dc8d49289b5036a0ecdf8 git.kernel.org
- https://git.kernel.org/stable/c/c9fc8428d4255c2128da9c4d5cd92e554d0150cf git.kernel.org
- https://git.kernel.org/stable/c/f49856f525acd5bef52ae28b7da2e001bbe7439e git.kernel.org
Source: the record CVE-2024-56712 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse