CVE-2025-39997
ALSA: usb-audio: fix race condition to UAF in snd_usbmidi_free
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.
INFO
Published Date :
Oct. 15, 2025, 8:15 a.m.
Last Modified :
Oct. 19, 2026, 9:10 p.m.
Remotely Exploit :
No
Source :
416baaa9-dc9f-4396-8d5f-8c081fb06d67
Solution
- Kill error timer and urb before freeing heap memory.
- Apply kernel updates to resolve the race condition.
- Ensure proper cleanup of timers and URBs.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2025-39997.
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2025-39997 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2025-39997
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2025-39997 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2025-39997 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Translated by [email protected]
Oct. 19, 2026
Action Type Old Value New Value Added Translation Title: Linux, Description: En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: ALSA: usb-audio: corregir condición de carrera a UAF en snd_usbmidi_free El commit anterior 0718a78f6a9f ('ALSA: usb-audio: Eliminar temporizador correctamente al retirar') parcheó un problema de UAF causado por el temporizador de error. Sin embargo, debido a que la eliminación del temporizador de error añadida en este parche ocurre después de la eliminación del punto final, una condición de carrera a UAF todavía ocurre, aunque raramente. Además, dado que la limpieza de eliminación para urb también falta, la memoria liberada puede ser accedida en contexto de interrupción relacionado con urb, lo que puede causar UAF. Por lo tanto, para prevenir esto, el temporizador de error y urb deben ser eliminados antes de liberar la memoria del montón. -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Oct. 15, 2026
Action Type Old Value New Value Added Reference https://git.kernel.org/stable/c/353d8c715cc951a980728133c9dd64ca5a0a186c Added Reference https://git.kernel.org/stable/c/647d6b8d22be12842fde6ed0c56859ebc615f21e Added Reference https://git.kernel.org/stable/c/9f2c0ac1423d5f267e7f1d1940780fc764b0fee3 Added Reference https://git.kernel.org/stable/c/af600e7f5526d16146b3ae99f6ad57bfea79ca33 Added Reference https://git.kernel.org/stable/c/dc4874366cf6cf4a31d8fa4b7f0e2a5b2d7647ba Added Reference https://git.kernel.org/stable/c/e16985513e89466a236d2a7c202783b4dd0c5a46 Added Reference https://git.kernel.org/stable/c/e63f049c7764b615d1d50cb486745fa63372b42d Removed Reference https://git.kernel.org/stable/c/353d8c715cc951a980728133c9dd64ca5a0a186c Removed Reference https://git.kernel.org/stable/c/647d6b8d22be12842fde6ed0c56859ebc615f21e Removed Reference https://git.kernel.org/stable/c/9f2c0ac1423d5f267e7f1d1940780fc764b0fee3 Removed Reference https://git.kernel.org/stable/c/af600e7f5526d16146b3ae99f6ad57bfea79ca33 Removed Reference https://git.kernel.org/stable/c/dc4874366cf6cf4a31d8fa4b7f0e2a5b2d7647ba Removed Reference https://git.kernel.org/stable/c/e16985513e89466a236d2a7c202783b4dd0c5a46 Removed Reference https://git.kernel.org/stable/c/e63f049c7764b615d1d50cb486745fa63372b42d -
CVE Modified by 0b142b55-0307-4c5a-b3c9-f314f3fb7c5e
Oct. 15, 2026
Action Type Old Value New Value Added Affected New affected value received. <a href="https://github.com/CVEProject/cvelistV5/blob/main/cves/2025/39xxx/CVE-2025-39997.json">CVE-2025-39997</a> Added Reference https://cert-portal.siemens.com/productcert/html/ssa-784472.html -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Jun. 17, 2026
Action Type Old Value New Value Added Affected [{'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'affected', 'version': '06513dd6d32c37d0364db8488cfdf3e14da238a8', 'lessThan': 'e63f049c7764b615d1d50cb486745fa63372b42d', 'versionType': 'git'}, {'status': 'affected', 'version': 'efaf61052b8ff9ee8968912fbaf02c2847c78ede', 'lessThan': 'e16985513e89466a236d2a7c202783b4dd0c5a46', 'versionType': 'git'}, {'status': 'affected', 'version': '647410a7da46067953a53c0d03f8680eff570959', 'lessThan': 'dc4874366cf6cf4a31d8fa4b7f0e2a5b2d7647ba', 'versionType': 'git'}, {'status': 'affected', 'version': 'c611b9e55174e439dcd85a72969b43a95f3827a4', 'lessThan': '647d6b8d22be12842fde6ed0c56859ebc615f21e', 'versionType': 'git'}, {'status': 'affected', 'version': '0718a78f6a9f04b88d0dc9616cc216b31c5f3cf1', 'lessThan': 'af600e7f5526d16146b3ae99f6ad57bfea79ca33', 'versionType': 'git'}, {'status': 'affected', 'version': '0718a78f6a9f04b88d0dc9616cc216b31c5f3cf1', 'lessThan': '353d8c715cc951a980728133c9dd64ca5a0a186c', 'versionType': 'git'}, {'status': 'affected', 'version': '0718a78f6a9f04b88d0dc9616cc216b31c5f3cf1', 'lessThan': '9f2c0ac1423d5f267e7f1d1940780fc764b0fee3', 'versionType': 'git'}, {'status': 'affected', 'version': '62066758d2ae169278e5d6aea5995b1b6f6ddeb5', 'versionType': 'git'}, {'status': 'affected', 'version': '6.1.167', 'lessThan': '6.1.175', 'versionType': 'semver'}, {'status': 'affected', 'version': '6.15.3', 'lessThan': '6.16', 'versionType': 'semver'}], 'programFiles': ['sound/usb/midi.c'], 'defaultStatus': 'unaffected'}, {'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'affected', 'version': '6.16'}, {'status': 'unaffected', 'version': '0', 'lessThan': '6.16', 'versionType': 'semver'}, {'status': 'unaffected', 'version': '6.1.175', 'versionType': 'semver', 'lessThanOrEqual': '6.1.*'}, {'status': 'unaffected', 'version': '6.16.11', 'versionType': 'semver', 'lessThanOrEqual': '6.16.*'}, {'status': 'unaffected', 'version': '6.17.1', 'versionType': 'semver', 'lessThanOrEqual': '6.17.*'}, {'status': 'unaffected', 'version': '6.18', 'versionType': 'original_commit_for_fix', 'lessThanOrEqual': '*'}], 'programFiles': ['sound/usb/midi.c'], 'defaultStatus': 'affected'}] -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Jun. 01, 2026
Action Type Old Value New Value Added Reference https://git.kernel.org/stable/c/e16985513e89466a236d2a7c202783b4dd0c5a46 Added Reference https://git.kernel.org/stable/c/e63f049c7764b615d1d50cb486745fa63372b42d -
New CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Oct. 15, 2025
Action Type Old Value New Value Added 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. Added Reference https://git.kernel.org/stable/c/353d8c715cc951a980728133c9dd64ca5a0a186c Added Reference https://git.kernel.org/stable/c/647d6b8d22be12842fde6ed0c56859ebc615f21e Added Reference https://git.kernel.org/stable/c/9f2c0ac1423d5f267e7f1d1940780fc764b0fee3 Added Reference https://git.kernel.org/stable/c/af600e7f5526d16146b3ae99f6ad57bfea79ca33 Added Reference https://git.kernel.org/stable/c/dc4874366cf6cf4a31d8fa4b7f0e2a5b2d7647ba