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 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.
Security readout for executives and security teams
Plain-English summary
CVE-2025-39997 is a Linux kernel bug in the ALSA USB audio/MIDI removal path. A rare race can let kernel code touch memory after it has been freed, which can crash systems or create undefined kernel behavior. Public sources do not provide CVSS, impact scoring, or confirmed exploitation.
Executive priority
Treat as a patch-management item with uncertain severity. Prioritize fleets where USB audio/MIDI devices are used or allowed, especially workstations, labs, kiosks, and systems with physical USB access.
Technical view
The flaw is a use-after-free race in snd_usbmidi_free. The prior timer cleanup fix ran too late, after endpoint deletion, and URB cleanup was also missing. The fix requires killing the error timer and URBs before freeing related heap memory.
Likely exposure
Exposure is likely limited to Linux systems running affected kernels that use the ALSA USB audio/MIDI code path. The source bundle lists affected Linux versions including 6.16, 6.1.175, 6.16.11, 6.17.1, and 6.18, but distribution backports must be verified separately.
Exploitation context
The CVE is not listed as KEV, and the supplied sources do not claim active exploitation or provide public exploit evidence. Attack prerequisites are not fully described; the bug is tied to USB audio/MIDI device cleanup and interrupt-context URB handling.
Researcher notes
The strongest evidence is the kernel fix description: timer cleanup after endpoint deletion still left a rare UAF, and missing URB kill-cleanup allowed interrupt-context access to freed memory. No CVSS, CWE, or exploitability detail is provided.
Mitigation direction
Apply vendor or distribution kernel updates containing the stable fixes.
Prioritize systems using USB audio or MIDI peripherals.
Check distribution advisories because kernel backports may change version-based exposure.
Where feasible, limit untrusted USB audio/MIDI device use until patched.
Validation and detection
Inventory Linux kernel versions across exposed endpoints and servers.
Check whether ALSA USB audio/MIDI support is present or loaded.
Map installed kernels against vendor advisories and the listed stable commits.
Confirm patched kernels include timer and URB cleanup before memory free.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2025-39997 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
0CVSS vectors
3Timeline events
0ADP providers
8Source links
Vulnerability timeline
Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.
CVE reservedCVE Program
The CVE ID was reserved by the assigning CNA.
CVE publishedCVE Program
The CVE record was published.
Oct 15, 2025, 07:58 UTC (UTC+00:00)
CVE updatedCVE Program
The CVE record metadata indicates this as the latest update time.