{"id":"CVE-2026-139329","state":"PUBLISHED","title":"ALSA: jack: Protect the index scan against control removal","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nALSA: jack: Protect the index scan against control removal\n\nA control found during a jack-name index scan must remain alive until\nsnd_ctl_find_id() finishes comparing its ID and count. However,\nget_available_index() calls it without holding card->controls_rwsem.\nWith CONFIG_SND_CTL_FAST_LOOKUP enabled, the lookup loads a raw control\npointer from ctl_hash and dereferences it in elem_id_matches() without\nany lock that excludes removal.\n\nThis can happen when a jack is created while a different jack owner on\nthe same card removes an existing control with the same name and index.\nFor example, probe and unbind of different HDA codecs can reach these\npaths on a shared card if their generated jack names match.\nThe codec device locks do not serialize operations on different\ncodecs. The unbind path can free the control during the index scan:\n\n  Codec A: probe                  Codec B: unbind\n  --------------                  ---------------\n  get_available_index()\n    snd_ctl_find_id()\n      kctl = xa_load(...)\n                                  hda_codec_driver_remove()\n                                    snd_hda_codec_cleanup_for_unbind()\n                                      snd_hda_jack_tbl_clear()\n                                        snd_device_free()\n                                          __snd_device_free()\n                                            snd_jack_dev_free()\n                                              snd_ctl_remove()\n                                                snd_ctl_remove_locked()\n                                                  __snd_ctl_remove()\n                                                    snd_ctl_free_one()\n                                                      kfree(kctl)\n      elem_id_matches(kctl, ...)\n        read freed id/count -> UAF\n\nHold controls_rwsem for read across the index scan so removal cannot\nfree a control until the lookup has finished using it. Release the lock\nwhen get_available_index() returns, before the caller adds the new\ncontrol under the write lock.","publishedAt":"2026-11-30T13:33:45.362Z","updatedAt":"2026-11-30T13:33:45.362Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"38ea4c3dc306edf6f4e483e8ad9cb8d33943afde","status":"affected","lessThan":"7d329eff434a7f55cb34fbda52d0295123783e78","versionType":"git"},{"version":"38ea4c3dc306edf6f4e483e8ad9cb8d33943afde","status":"affected","lessThan":"400874c97fbf537f6a58b5bb72ef3f78e2e2db52","versionType":"git"},{"version":"38ea4c3dc306edf6f4e483e8ad9cb8d33943afde","status":"affected","lessThan":"8c0f05570df41f7fe7cb8b9485647eaee8274343","versionType":"git"},{"version":"38ea4c3dc306edf6f4e483e8ad9cb8d33943afde","status":"affected","lessThan":"ba8c3d5fc27ac3f86962641dd3b6600906234bab","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["sound/core/ctljack.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.12","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/ctljack.c"]}],"references":["https://git.kernel.org/stable/c/7d329eff434a7f55cb34fbda52d0295123783e78","https://git.kernel.org/stable/c/400874c97fbf537f6a58b5bb72ef3f78e2e2db52","https://git.kernel.org/stable/c/8c0f05570df41f7fe7cb8b9485647eaee8274343","https://git.kernel.org/stable/c/ba8c3d5fc27ac3f86962641dd3b6600906234bab"],"weaknesses":[],"ingestedAt":"2026-11-30T13:48:04.491Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139329.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139329","state":"PUBLISHED","datePublished":"2026-11-30T13:33:45.362Z","dateUpdated":"2026-11-30T13:33:45.362Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.927Z"},"containers":{"cna":{"title":"ALSA: jack: Protect the index scan against control removal","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nALSA: jack: Protect the index scan against control removal\n\nA control found during a jack-name index scan must remain alive until\nsnd_ctl_find_id() finishes comparing its ID and count. However,\nget_available_index() calls it without holding card->controls_rwsem.\nWith CONFIG_SND_CTL_FAST_LOOKUP enabled, the lookup loads a raw control\npointer from ctl_hash and dereferences it in elem_id_matches() without\nany lock that excludes removal.\n\nThis can happen when a jack is created while a different jack owner on\nthe same card removes an existing control with the same name and index.\nFor example, probe and unbind of different HDA codecs can reach these\npaths on a shared card if their generated jack names match.\nThe codec device locks do not serialize operations on different\ncodecs. The unbind path can free the control during the index scan:\n\n  Codec A: probe                  Codec B: unbind\n  --------------                  ---------------\n  get_available_index()\n    snd_ctl_find_id()\n      kctl = xa_load(...)\n                                  hda_codec_driver_remove()\n                                    snd_hda_codec_cleanup_for_unbind()\n                                      snd_hda_jack_tbl_clear()\n                                        snd_device_free()\n                                          __snd_device_free()\n                                            snd_jack_dev_free()\n                                              snd_ctl_remove()\n                                                snd_ctl_remove_locked()\n                                                  __snd_ctl_remove()\n                                                    snd_ctl_free_one()\n                                                      kfree(kctl)\n      elem_id_matches(kctl, ...)\n        read freed id/count -> UAF\n\nHold controls_rwsem for read across the index scan so removal cannot\nfree a control until the lookup has finished using it. Release the lock\nwhen get_available_index() returns, before the caller adds the new\ncontrol under the write lock."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"38ea4c3dc306edf6f4e483e8ad9cb8d33943afde","status":"affected","lessThan":"7d329eff434a7f55cb34fbda52d0295123783e78","versionType":"git"},{"version":"38ea4c3dc306edf6f4e483e8ad9cb8d33943afde","status":"affected","lessThan":"400874c97fbf537f6a58b5bb72ef3f78e2e2db52","versionType":"git"},{"version":"38ea4c3dc306edf6f4e483e8ad9cb8d33943afde","status":"affected","lessThan":"8c0f05570df41f7fe7cb8b9485647eaee8274343","versionType":"git"},{"version":"38ea4c3dc306edf6f4e483e8ad9cb8d33943afde","status":"affected","lessThan":"ba8c3d5fc27ac3f86962641dd3b6600906234bab","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["sound/core/ctljack.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.12","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/ctljack.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/7d329eff434a7f55cb34fbda52d0295123783e78"},{"url":"https://git.kernel.org/stable/c/400874c97fbf537f6a58b5bb72ef3f78e2e2db52"},{"url":"https://git.kernel.org/stable/c/8c0f05570df41f7fe7cb8b9485647eaee8274343"},{"url":"https://git.kernel.org/stable/c/ba8c3d5fc27ac3f86962641dd3b6600906234bab"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:33:45.362Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12","versionEndExcluding":"6.12.119"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}