CVE-2026-143435: ALSA: pcm: Protect channel-map reads against runtime detach
In the Linux kernel, the following vulnerability has been resolved:
ALSA: pcm: Protect channel-map reads against runtime detach
Channel-map controls remain accessible between PCM opens. In-tree HDA code publishes the generic controls through addstdchmaps(), so a SNDRVCTLIOCTLELEMREAD can overlap the final close of the same PCM substream.
pcmchmapctlget() checks substream->runtime and later reads its channel count. Final close clears and frees that runtime under pcm->openmutex, while the control callback holds only controlsrwsem:
Control GET Final PCM close ----------- --------------- sndctlelemread() downread(controlsrwsem) pcmchmapctlget() check substream->runtime lock(pcm->openmutex) sndpcmreleasesubstream() sndpcmdetachsubstream() substream->runtime = NULL kfree(runtime) unlock(pcm->openmutex) substream->runtime->channels NULL or freed-pointer access upread(controlsrwsem)
Reloading the cleared field can fault through NULL, while retaining the old pointer can access freed storage. controlsrwsem keeps the control alive, but does not serialize the matching PCM close.
Copy the channel count under openmutex and use that scalar for the map lookup. Use trylock with -EBUSY because sndpcmdevdisconnect() takes openmutex before removing controls under controlsrwsem; blocking in the reverse order from GET could deadlock.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In pcm_chmap_ctl_get(), use trylock for pcm->open_mutex and return -EBUSY if it cannot be acquired; while holding it, check substream->runtime and copy the channel count to a scalar, then use that scalar for the channel map. This avoids reading runtime after final close frees it and avoids deadlock with control removal.
Event History
Frequently Asked Questions
Who is realistically exposed to this issue?
Systems using the Linux kernel ALSA PCM channel-map controls are exposed when generic channel-map controls are published, as in the in-tree HDA code. The race requires a PCM substream whose channel-map control remains accessible while the substream is being finally closed.
What does an attacker or triggering process need to do?
A local process needs to issue a SNDRV_CTL_IOCTL_ELEM_READ control read that overlaps the final close of the same PCM substream. The read can then access a runtime pointer after it has been cleared or freed.
How can I tell whether the race is occurring?
The described outcomes are a NULL-pointer fault or access to freed runtime storage during a channel-map control read concurrent with final PCM close. The supplied data does not provide a specific log signature or detection command.
What does the fix change?
The fix reads and copies the channel count while holding pcm->open_mutex, then uses that copied scalar for the channel-map lookup. This serializes access to the runtime-derived channel count with the PCM close path.