CVE-2026-139478: ALSA: core: Add missing barriers for power_ref vs card->shutdown
In the Linux kernel, the following vulnerability has been resolved:
ALSA: core: Add missing barriers for powerref vs card->shutdown
sndpowerrefandwait() increments card->powerref and then reads card->shutdown (and the power state) locklessly, while sndcarddisconnect() sets card->shutdown and then waits for powerref to drop to zero via sndpowersyncref(). Due to the missing barrier on both sides, the caller proceeds with shutdown still seen as false, while the disconnect side sees a zero refcount and continues tearing down incorrectly.
For addressing the potential race, add smpmbafteratomic() after the refcount increment and smpmb() before sndpowersyncref() in sndcarddisconnect().
Affected Software
Event History
Frequently Asked Questions
What condition is required for this race to occur?
The race requires concurrent execution of snd_power_ref_and_wait() and snd_card_disconnect(). The former increments card->power_ref and reads shutdown state without the required ordering, while the latter sets card->shutdown and waits for power_ref to reach zero.
What can happen if the race is triggered?
A caller can continue while still observing card->shutdown as false, even as disconnection is underway. At the same time, the disconnect path can observe a zero power reference count and proceed with teardown incorrectly.
How is the issue resolved?
The fix adds smp_mb__after_atomic() after the power reference increment in snd_power_ref_and_wait(). It also adds smp_mb() before snd_power_sync_ref() in snd_card_disconnect().