CVE-2026-139277

ALSA: pcm: Remove channel-map controls before freeing substreams

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

ALSA: pcm: Remove channel-map controls before freeing substreams

A late HDA codec bind on an already registered card builds new PCMs
before registering them. add_std_chmaps() publishes generic channel-map
controls during this BUILD stage. If an earlier chmap succeeds and a
later allocation fails, probe cleanup frees the BUILD PCM while the
card's control device remains accessible.

These generic controls are added directly by snd_pcm_add_chmap_ctls();
snd_hda_ctls_clear() only removes codec-tracked mixer controls. BUILD
devices also skip dev_disconnect. snd_pcm_free_stream() then frees the
substreams before free_chmap() withdraws their generic control:

Late HDA codec bind / rollback Control GET on the live card
------------------------------ ----------------------------
hda_codec_driver_probe()
snd_hda_codec_build_pcms()
PCM is BUILD
snd_hda_codec_build_controls()
add_std_chmaps()
publish an earlier chmap
later allocation: -ENOMEM
snd_hda_codec_cleanup_for_unbind()
snd_hda_ctls_clear()
generic chmap remains
codec_release_pcms()
snd_device_free()
BUILD: skip dev_disconnect
snd_pcm_free_stream()
kfree(substream)
snd_ctl_elem_read()
down_read(controls_rwsem)
pcm_chmap_ctl_get()
walk freed substream
free_chmap()
snd_ctl_remove()
wait for GET
up_read(controls_rwsem)

The control read lock cannot protect a substream already freed before
control removal starts. The failure above occurs before
snd_card_register(), so the PCM has not transitioned out of BUILD.

Move free_chmap() before the substream free loop. Its snd_ctl_remove()
withdraws the control and drains readers under controls_rwsem before any
substream is released. Normal registered-device disconnect already
removes the control, so the later call remains harmless on that path.

Analysis

AI-generated

Technical impact

The flaw occurs in the ALSA subsystem of the Linux kernel where late HDA codec binding creates generic channel‑map controls during a build stage. When a subsequent allocation fails, the cleanup path frees the build PCM but leaves the control device reachable. A user reading a channel‑map control on the live card can trigger a walk through a substream that has already been freed, resulting in a use‑after‑free condition. This memory corruption can expose kernel data or allow an attacker to execute code in the kernel context if they can control the read of these controls.

Affected Systems

All Linux installations that ship a kernel version containing the unpatched ALSA code are affected. The CPE entry indicates an issue in cpe:2.3:o:linux:linux_kernel:*, and no specific vendor or product version range is provided, so the vulnerability applies broadly to any distribution that has not yet updated the kernel to incorporate the fix.

Risk and Exploitability

The CVSS and EPSS scores are unavailable and the vulnerability is not listed in the KEV catalog, suggesting a moderate to high risk for local attackers. Because the issue requires an attacker with the ability to interact with ALSA controls, exploitation complexity is non‑trivial but not impractical. Administrators should treat the flaw as a serious local kernel risk and prioritize kernel upgrades that include the commit which removes channel‑map controls before freeing substreams. The absence of public exploits indicates no widespread active attacks, however, the use‑after‑free nature makes the vulnerability potentially exploitable by an experienced local actor.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the Linux kernel to a version that includes the ALSA patch that removes channel‑map controls before freeing substreams.
  • Verify that the running kernel includes the commit referenced in the advisory, such as the changes pulled from 476a4e4... and 7368815...
  • If an immediate kernel update is not possible, limit local user access to ALSA device files or disable sound functionality to reduce the attack surface.
  • Regularly monitor system logs for ALSA related errors or abnormal activity that could indicate an exploitation attempt.

Generated by OpenCVE AI on November 30, 2026 at 21:13 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-416
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: ALSA: pcm: Remove channel-map controls before freeing substreams A late HDA codec bind on an already registered card builds new PCMs before registering them. add_std_chmaps() publishes generic channel-map controls during this BUILD stage. If an earlier chmap succeeds and a later allocation fails, probe cleanup frees the BUILD PCM while the card's control device remains accessible. These generic controls are added directly by snd_pcm_add_chmap_ctls(); snd_hda_ctls_clear() only removes codec-tracked mixer controls. BUILD devices also skip dev_disconnect. snd_pcm_free_stream() then frees the substreams before free_chmap() withdraws their generic control: Late HDA codec bind / rollback Control GET on the live card ------------------------------ ---------------------------- hda_codec_driver_probe() snd_hda_codec_build_pcms() PCM is BUILD snd_hda_codec_build_controls() add_std_chmaps() publish an earlier chmap later allocation: -ENOMEM snd_hda_codec_cleanup_for_unbind() snd_hda_ctls_clear() generic chmap remains codec_release_pcms() snd_device_free() BUILD: skip dev_disconnect snd_pcm_free_stream() kfree(substream) snd_ctl_elem_read() down_read(controls_rwsem) pcm_chmap_ctl_get() walk freed substream free_chmap() snd_ctl_remove() wait for GET up_read(controls_rwsem) The control read lock cannot protect a substream already freed before control removal starts. The failure above occurs before snd_card_register(), so the PCM has not transitioned out of BUILD. Move free_chmap() before the substream free loop. Its snd_ctl_remove() withdraws the control and drains readers under controls_rwsem before any substream is released. Normal registered-device disconnect already removes the control, so the later call remains harmless on that path.
Title ALSA: pcm: Remove channel-map controls before freeing substreams
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:33 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Nov 30, 2026, 2:18 PM