{"id":"CVE-2026-142913","sourceIdentifier":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","published":"2026-12-03T04:18:31.233","lastModified":"2026-12-04T04:17:30.440","vulnStatus":"Received","cveTags":[],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nALSA: pcm: Protect delay DMA sync against concurrent HW_FREE\n\nA PCM DMA buffer must remain allocated until explicit DMA synchronization\nfinishes. snd_pcm_delay() calls snd_pcm_dma_buffer_sync() after dropping\nthe stream lock, without participating in the buffer-access exclusion\nused by HW_FREE.\n\nWith a managed NONCONTIG buffer requiring explicit sync, HW_PARAMS can\nallocate a separate runtime descriptor when the requested ring exceeds\nthe preallocation. In PREPARED state with mmap_count zero, concurrent\nHWSYNC and HW_FREE calls on the same open PCM file can interleave:\n\n1. HWSYNC checks the state in snd_pcm_delay() under the stream lock and\n   releases that lock.\n2. The sync helper fetches runtime->dma_buffer_p and enters\n   snd_dma_noncontig_sync() with that descriptor.\n3. HW_FREE takes the negative buffer-access count, checks PREPARED under\n   the stream lock, releases the lock, and frees the DMA allocation and\n   dynamic descriptor through snd_pcm_lib_free_pages().\n4. The sync callback resumes and reads the freed descriptor.\n\nThe stream lock does not cover the allocation's release, and the sync\noperation has no positive buffer-access count to prevent it. The stale\nread causes a use-after-free in snd_dma_noncontig_sync(). DELAY uses the\nsame snd_pcm_delay() path.\n\nTake a positive buffer-access count before checking the state and keep it\nuntil the DMA sync finishes, as the transfer and mmap paths already do.\nHW_FREE then returns -EBUSY while this access is active. If a buffer\nwriter has already entered, snd_pcm_delay() returns -EBUSY before using\nthe buffer. Keep the sync outside the stream lock and balance the count\non the state-error path as well.\n\nKASAN report as below:\n\n    BUG: KASAN: slab-use-after-free in snd_dma_noncontig_sync+0x295/0x310 [snd_pcm]\n    Read of size 4 at addr ffff888108f58584 by task pcm-uaf-fixture/487\n\n    CPU: 1 UID: 0 PID: 487 Comm: pcm-uaf-fixture 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     ? snd_dma_noncontig_sync+0x295/0x310 [snd_pcm]\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? __virt_addr_valid+0x20d/0x410\n     ? snd_dma_noncontig_sync+0x295/0x310 [snd_pcm]\n     kasan_report+0xe0/0x110\n     ? snd_dma_noncontig_sync+0x295/0x310 [snd_pcm]\n     ? __pfx_snd_dma_noncontig_sync+0x10/0x10 [snd_pcm]\n     snd_dma_noncontig_sync+0x295/0x310 [snd_pcm]\n     ? __pfx_snd_dma_noncontig_sync+0x10/0x10 [snd_pcm]\n     snd_dma_buffer_sync+0xc9/0x110 [snd_pcm]\n     snd_pcm_delay+0x3bd/0x550 [snd_pcm]\n     snd_pcm_common_ioctl+0x1e7/0x3aa0 [snd_pcm]\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? do_vfs_ioctl+0x1f5/0x1280\n     ? __pfx_do_vfs_ioctl+0x10/0x10\n     ? ioctl_has_perm.constprop.0.isra.0+0x34f/0x500\n     ? __pfx_snd_pcm_common_ioctl+0x10/0x10 [snd_pcm]\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     snd_pcm_ioctl+0x76/0xb0 [snd_pcm]\n     ? __pfx_snd_pcm_ioctl+0x10/0x10 [snd_pcm]\n     __x64_sys_ioctl+0x163/0x1d0\n     do_syscall_64+0x115/0x6a0\n     entry_SYSCALL_64_after_hwframe+0x77/0x7f\n    RIP: 0033:0x7f1cae7ab91b\n    Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00\n    RSP: 002b:00007ffe12d544f0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010\n    RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f1cae7ab91b\n    RDX: 0000000000000000 RSI: 0000000000004122 RDI: 0000000000000003\n    RBP: 00000000000001ee R08: 0000000000000073 R09: 00000000ffffffff\n    R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003\n    R13: 0000000000000001 R14: 00005584f32b1398 R15: 00005584f32b2ce8\n     </TASK>\n\n    Allocated by task 487:\n     kasan_sa\n---truncated---"}],"affected":[{"source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","affectedData":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","programFiles":["sound/core/pcm_native.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","versions":[{"version":"a25684a956468ee8bbbee44649e41e5d447e5adc","lessThan":"eb86ea542ca2cac9831dbed4dc8952adb1683302","versionType":"git","status":"affected"},{"version":"a25684a956468ee8bbbee44649e41e5d447e5adc","lessThan":"d34c692c6449f8db73c5b41edba70ecbab75c91f","versionType":"git","status":"affected"},{"version":"a25684a956468ee8bbbee44649e41e5d447e5adc","lessThan":"f27800a99e825cb642f32d9690c3772830e47a4d","versionType":"git","status":"affected"},{"version":"a25684a956468ee8bbbee44649e41e5d447e5adc","lessThan":"50f413b83b31ea8d8ee4276165ab95ed5ab0e10f","versionType":"git","status":"affected"}]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","programFiles":["sound/core/pcm_native.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","versions":[{"version":"5.16","status":"affected"},{"version":"0","lessThan":"5.16","versionType":"semver","status":"unaffected"},{"version":"6.12.119","lessThanOrEqual":"6.12.*","versionType":"semver","status":"unaffected"},{"version":"6.18.65","lessThanOrEqual":"6.18.*","versionType":"semver","status":"unaffected"},{"version":"7.3.6","lessThanOrEqual":"7.3.*","versionType":"semver","status":"unaffected"},{"version":"7.4-rc1","lessThanOrEqual":"*","versionType":"original_commit_for_fix","status":"unaffected"}]}]}],"metrics":{"cvssMetricV31":[{"source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","type":"Secondary","cvssData":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.0,"baseSeverity":"HIGH","attackVector":"LOCAL","attackComplexity":"HIGH","privilegesRequired":"LOW","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH"},"exploitabilityScore":1.0,"impactScore":5.9}]},"references":[{"url":"https://git.kernel.org/stable/c/50f413b83b31ea8d8ee4276165ab95ed5ab0e10f","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/d34c692c6449f8db73c5b41edba70ecbab75c91f","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/eb86ea542ca2cac9831dbed4dc8952adb1683302","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/f27800a99e825cb642f32d9690c3772830e47a4d","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"}]}