CVE-2026-80716: ALSA: pcm: wake linked drain waiters on unlink
In the Linux kernel, the following vulnerability has been resolved:
ALSA: pcm: wake linked drain waiters on unlink
sndpcmdrain() on a linked stream parks an on-stack wait entry on the drained peer's runtime->sleep, and after scheduletimeout() removes it only if that peer is still found in the caller's group. If group membership changes during the wait and the sleep ends by signal or timeout (so autoremovewakefunction() does not run), finishwait() is skipped and sndpcmdrain() returns with the entry still queued on that stream's sleep list; a later wakeup() then walks a freed stack frame. This is reachable by unlinking either the drained or the draining stream.
Unlike the close path (sndpcmdrop() -> sndpcmpoststop()), sndpcmunlink() never wakes the sleep queues. Wake every group member under the group lock before the membership change, so a linked drainer is released and drops its entry while the streams are still grouped.
The window was opened when sndpcmlinkrwsem stopped being held across the wait and the removal became conditional on group membership (see Fixes). The later switch to finishwait() kept that conditional removal, so the signal/timeout case remained.
Event History
Frequently Asked Questions
What conditions are required to trigger the use-after-free?
An ALSA PCM stream must be linked, with snd_pcm_drain() waiting on its peer. During that wait, either the drained or draining stream must be unlinked, and the wait must end by signal or timeout rather than by the normal wake path.
What happens after the affected drain call returns?
The drain operation can leave an on-stack wait entry queued on a stream sleep list. A later wake_up() on that list can then traverse the freed stack frame.