CVE-2025-39997
ALSA: usb-audio: fix race condition to UAF in snd_usbmidi_free
Check your servers for CVE-2025-39997
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-2025-39997 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:
ALSA: usb-audio: fix race condition to UAF in snd_usbmidi_free
The previous commit 0718a78f6a9f ("ALSA: usb-audio: Kill timer properly at removal") patched a UAF issue caused by the error timer.
However, because the error timer kill added in this patch occurs after the endpoint delete, a race condition to UAF still occurs, albeit rarely.
Additionally, since kill-cleanup for urb is also missing, freed memory can be accessed in interrupt context related to urb, which can cause UAF.
Therefore, to prevent this, error timer and urb must be killed before freeing the heap memory.
Exploitation
EPSS 0.21%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 12.0% of all scored CVEs. Scores of 1 Dec 2026.
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 06513dd6d32c37d0364db8488cfdf3e14da238a8, before e63f049c7764b615d1d50cb486745fa63372b42d affected from efaf61052b8ff9ee8968912fbaf02c2847c78ede, before e16985513e89466a236d2a7c202783b4dd0c5a46 affected from 647410a7da46067953a53c0d03f8680eff570959, before dc4874366cf6cf4a31d8fa4b7f0e2a5b2d7647ba affected from c611b9e55174e439dcd85a72969b43a95f3827a4, before 647d6b8d22be12842fde6ed0c56859ebc615f21e affected from 0718a78f6a9f04b88d0dc9616cc216b31c5f3cf1, before af600e7f5526d16146b3ae99f6ad57bfea79ca33 affected from 0718a78f6a9f04b88d0dc9616cc216b31c5f3cf1, before 353d8c715cc951a980728133c9dd64ca5a0a186c affected from 0718a78f6a9f04b88d0dc9616cc216b31c5f3cf1, before 9f2c0ac1423d5f267e7f1d1940780fc764b0fee3 affected 62066758d2ae169278e5d6aea5995b1b6f6ddeb5 affected from 6.1.167, before 6.1.175 affected from 6.15.3, before 6.16
Other versions: unaffected
|
| Linux |
affected 6.16 unaffected before 6.16 unaffected from 6.1.175 up to and including 6.1.* unaffected from 6.16.11 up to and including 6.16.* unaffected from 6.17.1 up to and including 6.17.* unaffected 6.18 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-2025-39997 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2025-39997
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-2025-39997
trivy image --scanners vuln IMAGE | grep CVE-2025-39997
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/e63f049c7764b615d1d50cb486745fa63372b42d git.kernel.org
- https://git.kernel.org/stable/c/e16985513e89466a236d2a7c202783b4dd0c5a46 git.kernel.org
- https://git.kernel.org/stable/c/dc4874366cf6cf4a31d8fa4b7f0e2a5b2d7647ba git.kernel.org
- https://git.kernel.org/stable/c/647d6b8d22be12842fde6ed0c56859ebc615f21e git.kernel.org
- https://git.kernel.org/stable/c/af600e7f5526d16146b3ae99f6ad57bfea79ca33 git.kernel.org
- https://git.kernel.org/stable/c/353d8c715cc951a980728133c9dd64ca5a0a186c git.kernel.org
- https://git.kernel.org/stable/c/9f2c0ac1423d5f267e7f1d1940780fc764b0fee3 git.kernel.org
- https://cert-portal.siemens.com/productcert/html/ssa-784472.html cert-portal.siemens.com
Source: the record CVE-2025-39997 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse