CVE-2026-139351: ALSA: core: Serialize snd_refcount put and sync
In the Linux kernel, the following vulnerability has been resolved:
ALSA: core: Serialize sndrefcount put and sync
When a thread tries to sync-and-destroy the resource with sndrefcountsync(), it might lead to a UAF in a very slight time window. Namely, sndrefountput() calls wakeup() after atomicdecandtest(), but waitevent() in sndrefcountsync() checks the condition via atomictest() without serialization, hence the thread that called sndrefcountsync() can continue immediately to release the resource before another thread calls wakeup().
For avoiding the race above, introduce the spinlock and take it at sndrefcountput() and sndrefcountsync() in order to serialize the operations.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Introduce a spinlock and use it in snd_refcount_put() and snd_refcount_sync() to serialize their operations.
Event History
Frequently Asked Questions
What conditions are required for this race to occur?
The issue requires concurrent activity: one thread must call snd_refcount_sync() to synchronize and destroy a resource while another thread performs snd_refcount_put(). The use-after-free is possible only in the narrow window caused by the lack of serialization between the reference-count check and wake-up.
What does the fix change?
The fix adds a spinlock and acquires it in both snd_refcount_put() and snd_refcount_sync(). This serializes the put and sync operations so that a resource cannot be released before the concurrent reference-count operation is properly synchronized.