CVE-2025-39997: ALSA: usb-audio: fix race condition to UAF in snd_usbmidi_free
In the Linux kernel, the following vulnerability has been resolved:
ALSA: usb-audio: fix race condition to UAF in sndusbmidifree
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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.175 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.16 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.16.11 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.17.1
Event History
Frequently Asked Questions
What is the severity of CVE-2025-39997?
CVE-2025-39997 is classified as a medium severity vulnerability in the Linux kernel.
How do I fix CVE-2025-39997?
To fix CVE-2025-39997, you should update your Linux kernel to the latest version that includes the relevant patches.
What type of vulnerability is CVE-2025-39997?
CVE-2025-39997 is a use-after-free (UAF) vulnerability caused by a race condition in the USB MIDI audio driver.
Which versions of Linux Kernel are affected by CVE-2025-39997?
CVE-2025-39997 affects multiple versions of the Linux kernel prior to the respective fix being applied.
Can CVE-2025-39997 be exploited remotely?
Yes, CVE-2025-39997 can potentially be exploited remotely if attackers can trigger the situation that leads to the use-after-free condition.