{"id":"CVE-2026-139421","state":"PUBLISHED","title":"ALSA: jack: Remove debugfs before freeing unregistered jacks","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nALSA: jack: Remove debugfs before freeing unregistered jacks\n\nJack debugfs files store a raw snd_jack_kctl pointer, so their\ncallbacks must be drained before the attachment is freed.\nsnd_jack_dev_free() unlinks and frees the attachments before calling\nsnd_jack_dev_disconnect(). Its late snd_jack_remove_debugfs() call\nthen has no entries left to traverse.\n\nWith CONFIG_SND_JACK_INJECTION_DEBUG and input support enabled, an\nHDA codec rebind on a live card can publish a non-phantom jack's type\nfile while its component is still in SNDRV_DEV_BUILD. A later\njack-control allocation failure permits the following order:\n\n  1. hda_codec_driver_probe() creates a jack and publishes its debugfs\n     files before reaching snd_card_register().\n  2. A later control-build failure calls\n     snd_hda_codec_cleanup_for_unbind(), then snd_hda_jack_tbl_clear()\n     and snd_device_free(). __snd_device_disconnect() skips BUILD\n     components. snd_jack_dev_free() frees the attachment before its\n     late disconnect, leaving the debugfs files published.\n  3. After cleanup, a reader opens the surviving type file and\n     jack_type_read() dereferences the freed attachment's jack pointer.\n\nThe card's debugfs root remains live throughout this sequence. The\nresult is a use-after-free even without an overlapping read. An\nalready admitted callback is also not drained by this cleanup.\n\nCall snd_jack_remove_debugfs() before unlinking any controls in the\nfree callback. The existing debugfs_remove() rundown blocks new\naccesses and waits for active callbacks while the attachment, control\nand jack remain valid. Roots cleared by an earlier disconnect are\nNULL, so repeating the removal is harmless.\n\nKASAN report as below:\n\n    ==================================================================\n    BUG: KASAN: slab-use-after-free in jack_type_read+0x1da/0x1f0\n    Read of size 8 at addr ffff8881085f9da0 by task python3/429\n\n    CPU: 2 UID: 0 PID: 429 Comm: python3 Not tainted 7.2.0-rc6-pmb-alsa-functional-v2+ #1 PREEMPT(lazy)\n    Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014\n    Call Trace:\n     <TASK>\n     dump_stack_lvl+0x93/0xd0\n     print_report+0xce/0x630\n     ? jack_type_read+0x1da/0x1f0\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? __virt_addr_valid+0x20d/0x410\n     ? jack_type_read+0x1da/0x1f0\n     kasan_report+0xe0/0x110\n     ? jack_type_read+0x1da/0x1f0\n     jack_type_read+0x1da/0x1f0\n     ? __pfx_jack_type_read+0x10/0x10\n     ? __pfx___debugfs_file_get+0x10/0x10\n     ? __pfx_cp_new_stat+0x10/0x10\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? selinux_file_permission+0x122/0x570\n     full_proxy_read+0x11f/0x180\n     ? __pfx_full_proxy_read+0x10/0x10\n     vfs_read+0x1a0/0xc20\n     ? __pfx_vfs_read+0x10/0x10\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? __do_sys_newfstat+0xa6/0x100\n     ? find_held_lock+0x2b/0x80\n     ? __pfx___do_sys_newfstat+0x10/0x10\n     ksys_read+0x111/0x200\n     ? __pfx_ksys_read+0x10/0x10\n     ? full_proxy_llseek+0x11e/0x170\n     do_syscall_64+0x115/0x6a0\n     entry_SYSCALL_64_after_hwframe+0x77/0x7f\n    RIP: 0033:0x7f7e392e7687\n    Code: 48 89 fa 4c 89 df e8 58 b3 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff\n    RSP: 002b:00007fff5f7b9180 EFLAGS: 00000202 ORIG_RAX: 0000000000000000\n    RAX: ffffffffffffffda RBX: 00007f7e39253780 RCX: 00007f7e392e7687\n    RDX: 0000000000002000 RSI: 000000003d2e9b00 RDI: 0000000000000003\n    RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000\n    R10: 0000000000000000 R11: 0000000000000202 R12: 00007f7e39253700\n    R13: 0000000000002000 R14: 00007f7e38d7e2c0 R15: 0000000000a55b98\n     </TASK>\n\n    Allocated by task 425:\n     kasan_save_stack+0x33/0x60\n     kasan_sav\n---truncated---","publishedAt":"2026-11-30T13:34:35.903Z","updatedAt":"2026-11-30T13:34:35.903Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1834922d443199c4bae7faa22442d3dbd32265c5","status":"affected","lessThan":"e1eecdbdae105a365809e0fbb401e41eefa7a64c","versionType":"git"},{"version":"cb9c2bd4ec8cdd1aee71fb7a895298bb1246a68b","status":"affected","lessThan":"7531379fcdb4c25dac75b5702028dac4e5836055","versionType":"git"},{"version":"495000a38634e640e2fd02f7e4f1512ccc92d770","status":"affected","lessThan":"014db5b29cd5646bbeff04ddad29b5dcb07908b1","versionType":"git"},{"version":"495000a38634e640e2fd02f7e4f1512ccc92d770","status":"affected","lessThan":"5aeea1f3fadf40d6585be3463f0d35a206267a73","versionType":"git"},{"version":"495000a38634e640e2fd02f7e4f1512ccc92d770","status":"affected","lessThan":"ee9e1364fc84f9f967eaae147a385eb1b857f9b0","versionType":"git"},{"version":"495000a38634e640e2fd02f7e4f1512ccc92d770","status":"affected","lessThan":"d3b59d50e1ff206aa519ed5c13bf6907f97dd6a6","versionType":"git"},{"version":"7238bbf605cbc8ac26b51787e7e0928fc4a44cff","status":"affected","versionType":"git"},{"version":"6.1.93","status":"affected","lessThan":"6.1.193","versionType":"semver"},{"version":"6.6.33","status":"affected","lessThan":"6.6.163","versionType":"semver"},{"version":"6.9.4","status":"affected","lessThan":"6.10","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["sound/core/jack.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.10","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/jack.c"]}],"references":["https://git.kernel.org/stable/c/e1eecdbdae105a365809e0fbb401e41eefa7a64c","https://git.kernel.org/stable/c/7531379fcdb4c25dac75b5702028dac4e5836055","https://git.kernel.org/stable/c/014db5b29cd5646bbeff04ddad29b5dcb07908b1","https://git.kernel.org/stable/c/5aeea1f3fadf40d6585be3463f0d35a206267a73","https://git.kernel.org/stable/c/ee9e1364fc84f9f967eaae147a385eb1b857f9b0","https://git.kernel.org/stable/c/d3b59d50e1ff206aa519ed5c13bf6907f97dd6a6"],"weaknesses":[],"ingestedAt":"2026-11-30T13:48:04.491Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139421.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139421","state":"PUBLISHED","datePublished":"2026-11-30T13:34:35.903Z","dateUpdated":"2026-11-30T13:34:35.903Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.932Z"},"containers":{"cna":{"title":"ALSA: jack: Remove debugfs before freeing unregistered jacks","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nALSA: jack: Remove debugfs before freeing unregistered jacks\n\nJack debugfs files store a raw snd_jack_kctl pointer, so their\ncallbacks must be drained before the attachment is freed.\nsnd_jack_dev_free() unlinks and frees the attachments before calling\nsnd_jack_dev_disconnect(). Its late snd_jack_remove_debugfs() call\nthen has no entries left to traverse.\n\nWith CONFIG_SND_JACK_INJECTION_DEBUG and input support enabled, an\nHDA codec rebind on a live card can publish a non-phantom jack's type\nfile while its component is still in SNDRV_DEV_BUILD. A later\njack-control allocation failure permits the following order:\n\n  1. hda_codec_driver_probe() creates a jack and publishes its debugfs\n     files before reaching snd_card_register().\n  2. A later control-build failure calls\n     snd_hda_codec_cleanup_for_unbind(), then snd_hda_jack_tbl_clear()\n     and snd_device_free(). __snd_device_disconnect() skips BUILD\n     components. snd_jack_dev_free() frees the attachment before its\n     late disconnect, leaving the debugfs files published.\n  3. After cleanup, a reader opens the surviving type file and\n     jack_type_read() dereferences the freed attachment's jack pointer.\n\nThe card's debugfs root remains live throughout this sequence. The\nresult is a use-after-free even without an overlapping read. An\nalready admitted callback is also not drained by this cleanup.\n\nCall snd_jack_remove_debugfs() before unlinking any controls in the\nfree callback. The existing debugfs_remove() rundown blocks new\naccesses and waits for active callbacks while the attachment, control\nand jack remain valid. Roots cleared by an earlier disconnect are\nNULL, so repeating the removal is harmless.\n\nKASAN report as below:\n\n    ==================================================================\n    BUG: KASAN: slab-use-after-free in jack_type_read+0x1da/0x1f0\n    Read of size 8 at addr ffff8881085f9da0 by task python3/429\n\n    CPU: 2 UID: 0 PID: 429 Comm: python3 Not tainted 7.2.0-rc6-pmb-alsa-functional-v2+ #1 PREEMPT(lazy)\n    Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014\n    Call Trace:\n     <TASK>\n     dump_stack_lvl+0x93/0xd0\n     print_report+0xce/0x630\n     ? jack_type_read+0x1da/0x1f0\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? __virt_addr_valid+0x20d/0x410\n     ? jack_type_read+0x1da/0x1f0\n     kasan_report+0xe0/0x110\n     ? jack_type_read+0x1da/0x1f0\n     jack_type_read+0x1da/0x1f0\n     ? __pfx_jack_type_read+0x10/0x10\n     ? __pfx___debugfs_file_get+0x10/0x10\n     ? __pfx_cp_new_stat+0x10/0x10\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? selinux_file_permission+0x122/0x570\n     full_proxy_read+0x11f/0x180\n     ? __pfx_full_proxy_read+0x10/0x10\n     vfs_read+0x1a0/0xc20\n     ? __pfx_vfs_read+0x10/0x10\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? __do_sys_newfstat+0xa6/0x100\n     ? find_held_lock+0x2b/0x80\n     ? __pfx___do_sys_newfstat+0x10/0x10\n     ksys_read+0x111/0x200\n     ? __pfx_ksys_read+0x10/0x10\n     ? full_proxy_llseek+0x11e/0x170\n     do_syscall_64+0x115/0x6a0\n     entry_SYSCALL_64_after_hwframe+0x77/0x7f\n    RIP: 0033:0x7f7e392e7687\n    Code: 48 89 fa 4c 89 df e8 58 b3 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff\n    RSP: 002b:00007fff5f7b9180 EFLAGS: 00000202 ORIG_RAX: 0000000000000000\n    RAX: ffffffffffffffda RBX: 00007f7e39253780 RCX: 00007f7e392e7687\n    RDX: 0000000000002000 RSI: 000000003d2e9b00 RDI: 0000000000000003\n    RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000\n    R10: 0000000000000000 R11: 0000000000000202 R12: 00007f7e39253700\n    R13: 0000000000002000 R14: 00007f7e38d7e2c0 R15: 0000000000a55b98\n     </TASK>\n\n    Allocated by task 425:\n     kasan_save_stack+0x33/0x60\n     kasan_sav\n---truncated---"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1834922d443199c4bae7faa22442d3dbd32265c5","status":"affected","lessThan":"e1eecdbdae105a365809e0fbb401e41eefa7a64c","versionType":"git"},{"version":"cb9c2bd4ec8cdd1aee71fb7a895298bb1246a68b","status":"affected","lessThan":"7531379fcdb4c25dac75b5702028dac4e5836055","versionType":"git"},{"version":"495000a38634e640e2fd02f7e4f1512ccc92d770","status":"affected","lessThan":"014db5b29cd5646bbeff04ddad29b5dcb07908b1","versionType":"git"},{"version":"495000a38634e640e2fd02f7e4f1512ccc92d770","status":"affected","lessThan":"5aeea1f3fadf40d6585be3463f0d35a206267a73","versionType":"git"},{"version":"495000a38634e640e2fd02f7e4f1512ccc92d770","status":"affected","lessThan":"ee9e1364fc84f9f967eaae147a385eb1b857f9b0","versionType":"git"},{"version":"495000a38634e640e2fd02f7e4f1512ccc92d770","status":"affected","lessThan":"d3b59d50e1ff206aa519ed5c13bf6907f97dd6a6","versionType":"git"},{"version":"7238bbf605cbc8ac26b51787e7e0928fc4a44cff","status":"affected","versionType":"git"},{"version":"6.1.93","status":"affected","lessThan":"6.1.193","versionType":"semver"},{"version":"6.6.33","status":"affected","lessThan":"6.6.163","versionType":"semver"},{"version":"6.9.4","status":"affected","lessThan":"6.10","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["sound/core/jack.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.10","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/jack.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/e1eecdbdae105a365809e0fbb401e41eefa7a64c"},{"url":"https://git.kernel.org/stable/c/7531379fcdb4c25dac75b5702028dac4e5836055"},{"url":"https://git.kernel.org/stable/c/014db5b29cd5646bbeff04ddad29b5dcb07908b1"},{"url":"https://git.kernel.org/stable/c/5aeea1f3fadf40d6585be3463f0d35a206267a73"},{"url":"https://git.kernel.org/stable/c/ee9e1364fc84f9f967eaae147a385eb1b857f9b0"},{"url":"https://git.kernel.org/stable/c/d3b59d50e1ff206aa519ed5c13bf6907f97dd6a6"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:34:35.903Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.1.93","versionEndExcluding":"6.1.193"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6.33","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"6.12.119"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"7.4-rc1"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.9.4"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}