ALSA: usb-audio: fix race condition to UAF in snd_usbmidi_free
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 0718a78f6a9f04b88d0dc9616cc216b31c5f3cf1 · < 353d8c715cc951a980728133c9dd64ca5a0a186c| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
The Linux kernel’s ALSA USB audio code has a race during MIDI endpoint cleanup that can cause a use-after-free. An error timer or USB request can access freed memory if cleanup occurs after the memory is freed. The input does not specify an attack path, authentication requirements, or user interaction.
Engineers running the Linux kernel with ALSA USB audio should check whether their kernel is affected; affected versions are not specified.