{"id":"CVE-2026-139277","state":"PUBLISHED","title":"ALSA: pcm: Remove channel-map controls before freeing substreams","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nALSA: pcm: Remove channel-map controls before freeing substreams\n\nA late HDA codec bind on an already registered card builds new PCMs\nbefore registering them. add_std_chmaps() publishes generic channel-map\ncontrols during this BUILD stage. If an earlier chmap succeeds and a\nlater allocation fails, probe cleanup frees the BUILD PCM while the\ncard's control device remains accessible.\n\nThese generic controls are added directly by snd_pcm_add_chmap_ctls();\nsnd_hda_ctls_clear() only removes codec-tracked mixer controls. BUILD\ndevices also skip dev_disconnect. snd_pcm_free_stream() then frees the\nsubstreams before free_chmap() withdraws their generic control:\n\n  Late HDA codec bind / rollback        Control GET on the live card\n  ------------------------------       ----------------------------\n  hda_codec_driver_probe()\n    snd_hda_codec_build_pcms()\n      PCM is BUILD\n    snd_hda_codec_build_controls()\n      add_std_chmaps()\n        publish an earlier chmap\n        later allocation: -ENOMEM\n    snd_hda_codec_cleanup_for_unbind()\n      snd_hda_ctls_clear()\n        generic chmap remains\n      codec_release_pcms()\n        snd_device_free()\n          BUILD: skip dev_disconnect\n          snd_pcm_free_stream()\n            kfree(substream)\n                                       snd_ctl_elem_read()\n                                         down_read(controls_rwsem)\n                                         pcm_chmap_ctl_get()\n                                           walk freed substream\n            free_chmap()\n              snd_ctl_remove()\n                wait for GET\n                                         up_read(controls_rwsem)\n\nThe control read lock cannot protect a substream already freed before\ncontrol removal starts. The failure above occurs before\nsnd_card_register(), so the PCM has not transitioned out of BUILD.\n\nMove free_chmap() before the substream free loop. Its snd_ctl_remove()\nwithdraws the control and drains readers under controls_rwsem before any\nsubstream is released. Normal registered-device disconnect already\nremoves the control, so the later call remains harmless on that path.","publishedAt":"2026-11-30T13:33:16.014Z","updatedAt":"2026-11-30T13:33:16.014Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"2d3391ec0ecca37efb6bc995906292f47522b471","status":"affected","lessThan":"736881539d313a92fd5b67cc80ed0e0906d1f9d3","versionType":"git"},{"version":"2d3391ec0ecca37efb6bc995906292f47522b471","status":"affected","lessThan":"df6fe78536c7ffd33381a789563495f757cd521c","versionType":"git"},{"version":"2d3391ec0ecca37efb6bc995906292f47522b471","status":"affected","lessThan":"d7245e5c7b6c4419f811494298215b07657e30e2","versionType":"git"},{"version":"2d3391ec0ecca37efb6bc995906292f47522b471","status":"affected","lessThan":"d80f03e41802c0605be48e6759659e10cf3117bd","versionType":"git"},{"version":"2d3391ec0ecca37efb6bc995906292f47522b471","status":"affected","lessThan":"7c445a41b80be76d4474baef3e65ae5c815fae8f","versionType":"git"},{"version":"2d3391ec0ecca37efb6bc995906292f47522b471","status":"affected","lessThan":"476a4e4dbd11635a4e00f0c2a9ef2e5a370f3d26","versionType":"git"},{"version":"2d3391ec0ecca37efb6bc995906292f47522b471","status":"affected","lessThan":"da3978f32236816cdaed20079c9c7d9d088eeed8","versionType":"git"},{"version":"2d3391ec0ecca37efb6bc995906292f47522b471","status":"affected","lessThan":"d5dd05c1f72a95d8ab06828d7272a185ad2b9185","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["sound/core/pcm.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.7","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.7","versionType":"semver"},{"version":"5.10.275","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.226","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.193","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.119","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["sound/core/pcm.c"]}],"references":["https://git.kernel.org/stable/c/736881539d313a92fd5b67cc80ed0e0906d1f9d3","https://git.kernel.org/stable/c/df6fe78536c7ffd33381a789563495f757cd521c","https://git.kernel.org/stable/c/d7245e5c7b6c4419f811494298215b07657e30e2","https://git.kernel.org/stable/c/d80f03e41802c0605be48e6759659e10cf3117bd","https://git.kernel.org/stable/c/7c445a41b80be76d4474baef3e65ae5c815fae8f","https://git.kernel.org/stable/c/476a4e4dbd11635a4e00f0c2a9ef2e5a370f3d26","https://git.kernel.org/stable/c/da3978f32236816cdaed20079c9c7d9d088eeed8","https://git.kernel.org/stable/c/d5dd05c1f72a95d8ab06828d7272a185ad2b9185"],"weaknesses":[],"ingestedAt":"2026-11-30T13:46:04.484Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139277.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139277","state":"PUBLISHED","datePublished":"2026-11-30T13:33:16.014Z","dateUpdated":"2026-11-30T13:33:16.014Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.924Z"},"containers":{"cna":{"title":"ALSA: pcm: Remove channel-map controls before freeing substreams","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nALSA: pcm: Remove channel-map controls before freeing substreams\n\nA late HDA codec bind on an already registered card builds new PCMs\nbefore registering them. add_std_chmaps() publishes generic channel-map\ncontrols during this BUILD stage. If an earlier chmap succeeds and a\nlater allocation fails, probe cleanup frees the BUILD PCM while the\ncard's control device remains accessible.\n\nThese generic controls are added directly by snd_pcm_add_chmap_ctls();\nsnd_hda_ctls_clear() only removes codec-tracked mixer controls. BUILD\ndevices also skip dev_disconnect. snd_pcm_free_stream() then frees the\nsubstreams before free_chmap() withdraws their generic control:\n\n  Late HDA codec bind / rollback        Control GET on the live card\n  ------------------------------       ----------------------------\n  hda_codec_driver_probe()\n    snd_hda_codec_build_pcms()\n      PCM is BUILD\n    snd_hda_codec_build_controls()\n      add_std_chmaps()\n        publish an earlier chmap\n        later allocation: -ENOMEM\n    snd_hda_codec_cleanup_for_unbind()\n      snd_hda_ctls_clear()\n        generic chmap remains\n      codec_release_pcms()\n        snd_device_free()\n          BUILD: skip dev_disconnect\n          snd_pcm_free_stream()\n            kfree(substream)\n                                       snd_ctl_elem_read()\n                                         down_read(controls_rwsem)\n                                         pcm_chmap_ctl_get()\n                                           walk freed substream\n            free_chmap()\n              snd_ctl_remove()\n                wait for GET\n                                         up_read(controls_rwsem)\n\nThe control read lock cannot protect a substream already freed before\ncontrol removal starts. The failure above occurs before\nsnd_card_register(), so the PCM has not transitioned out of BUILD.\n\nMove free_chmap() before the substream free loop. Its snd_ctl_remove()\nwithdraws the control and drains readers under controls_rwsem before any\nsubstream is released. Normal registered-device disconnect already\nremoves the control, so the later call remains harmless on that path."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"2d3391ec0ecca37efb6bc995906292f47522b471","status":"affected","lessThan":"736881539d313a92fd5b67cc80ed0e0906d1f9d3","versionType":"git"},{"version":"2d3391ec0ecca37efb6bc995906292f47522b471","status":"affected","lessThan":"df6fe78536c7ffd33381a789563495f757cd521c","versionType":"git"},{"version":"2d3391ec0ecca37efb6bc995906292f47522b471","status":"affected","lessThan":"d7245e5c7b6c4419f811494298215b07657e30e2","versionType":"git"},{"version":"2d3391ec0ecca37efb6bc995906292f47522b471","status":"affected","lessThan":"d80f03e41802c0605be48e6759659e10cf3117bd","versionType":"git"},{"version":"2d3391ec0ecca37efb6bc995906292f47522b471","status":"affected","lessThan":"7c445a41b80be76d4474baef3e65ae5c815fae8f","versionType":"git"},{"version":"2d3391ec0ecca37efb6bc995906292f47522b471","status":"affected","lessThan":"476a4e4dbd11635a4e00f0c2a9ef2e5a370f3d26","versionType":"git"},{"version":"2d3391ec0ecca37efb6bc995906292f47522b471","status":"affected","lessThan":"da3978f32236816cdaed20079c9c7d9d088eeed8","versionType":"git"},{"version":"2d3391ec0ecca37efb6bc995906292f47522b471","status":"affected","lessThan":"d5dd05c1f72a95d8ab06828d7272a185ad2b9185","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["sound/core/pcm.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.7","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.7","versionType":"semver"},{"version":"5.10.275","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.226","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.193","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.119","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["sound/core/pcm.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/736881539d313a92fd5b67cc80ed0e0906d1f9d3"},{"url":"https://git.kernel.org/stable/c/df6fe78536c7ffd33381a789563495f757cd521c"},{"url":"https://git.kernel.org/stable/c/d7245e5c7b6c4419f811494298215b07657e30e2"},{"url":"https://git.kernel.org/stable/c/d80f03e41802c0605be48e6759659e10cf3117bd"},{"url":"https://git.kernel.org/stable/c/7c445a41b80be76d4474baef3e65ae5c815fae8f"},{"url":"https://git.kernel.org/stable/c/476a4e4dbd11635a4e00f0c2a9ef2e5a370f3d26"},{"url":"https://git.kernel.org/stable/c/da3978f32236816cdaed20079c9c7d9d088eeed8"},{"url":"https://git.kernel.org/stable/c/d5dd05c1f72a95d8ab06828d7272a185ad2b9185"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:33:16.014Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"5.10.275"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"5.15.226"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"6.1.193"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"6.12.119"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}