CVE-2026-139272: ALSA: aloop: Keep the timer source alive until card release
In the Linux kernel, the following vulnerability has been resolved:
ALSA: aloop: Keep the timer source alive until card release
The timersource string must remain valid while PCM opens can select and parse it. loopbacksettimersource() allocates the string with parent-device devres, which can release it while the card is still registered.
A successful nonempty proc replacement after sndcardregister() adds the string allocation after triggercardfree. Unbinding the platform device while sndaloop remains loaded releases devres in reverse order. An open for an unused cable can run after the string is freed and before the card-free action disconnects the card:
Device unbind PCM open devresreleaseall() free replacement string sndpcmopen() sndcardfileadd() loopbackopen() loopbacksndtimeropen() loopbackparsetimerid() triggercardfree() sndcardfree() sndcarddisconnect()
The parser can then read freed memory. KASAN has reported a one-byte use-after-free read in strchr() from loopbacksndtimeropen(). The cablelock mutex serializes explicit replacements with opens, but implicit devres release does not take it. The card and module references held by PCM open do not retain this separate devres allocation.
Use kstrdup() and release the current string from card->privatefree. PCM admission already retains the card until each file is removed, and card disconnect drains proc callbacks before final card release. This keeps the string alive across admitted PCM opens and preserves the cablelock serialization of replacements. Install the callback before the initial allocation so probe failures also release the string.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In ALSA aloop, allocate timer_source with kstrdup() and release the current string from card->private_free, including the initial allocation so probe failures also free it.