KernelScan.io

HIGH

sound PcmMmap UAF

CVE-2026-98116

CVSS 7.8 / 10.0 NVD

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

KernelScan AI6.7MEDIUM

01

In the Linux kernel, the following vulnerability has been resolved: ALSA: pcm: Serialize PCM mmap with buffer reallocation to fix page UAF snd_pcm_hw_params() and snd_pcm_hw_free() guard buffer reallocation with an mmap_count check performed under the PCM stream lock, but the lock is released long before the buffer is actually freed: snd_pcm_sync_stop(), constraint refinement and do_free_pages() all happen in between. snd_pcm_mmap_data(), on the other hand, takes no lock at all: it validates against the old buffer's state and dma_bytes, remaps its pages into the VMA, and only then increments mmap_count. A concurrent mmap() can therefore slip in between the check and the free. remap_pfn_range() installs writable PTEs for the old buffer's pages without taking page references, and the subsequent do_free_pages() returns those pages to the page allocator while the VMA still maps them. This leaves a stale, writable mapping of freed pages: a page-level use-after-free that can be leveraged for local privilege escalation. Make snd_pcm_mmap_data() participate in the buffer-access scheme introduced for hw_params/hw_free: acquire runtime->buffer_accessing before validating and remapping, and release it afterwards. Buffer reallocation already fails with -EBUSY while accessors are active, and the mmap side now fails with -EBUSY while a reallocation is in progress, so the validate/remap sequence and the check/free sequence can no longer interleave. A reproducer that turns this race into a stale writable mapping of the freed DMA buffer pages is available on request.

02

Engine v0.6.0

Risk summary

A local user with access to an ALSA PCM audio device can exploit a race condition between mmap and buffer reallocation to create a stale writable mapping of freed DMA buffer pages. This page-level use-after-free can be leveraged for local privilege escalation, granting arbitrary kernel read and write capabilities to an unprivileged attacker.

Affectedsound/core/pcm_native.c (ALSA PCM)

Vulnerability analysis

A race condition exists between the ALSA PCM mmap path and the buffer reallocation logic in the hardware parameter setup and teardown ioctls. The mmap path takes no lock while it validates the current buffer state and remaps DMA buffer pages into a process's address space; meanwhile, the reallocation path checks whether any mmap is active but releases the stream lock before actually freeing the old buffer. A concurrent mmap can therefore install writable mappings of pages that are then returned to the page allocator, leaving the process with a writable mapping of freed kernel pages — a page-level use-after-free usable for local privilege escalation. The fix makes the mmap path acquire a buffer-access atomic counter before validation and remapping, and release it afterwards, so the mmap and reallocation sequences can no longer interleave. This is reachable by any local user who can open and interact with a PCM audio device, which on most systems is accessible to non-root users.

03

BranchIntroducedFixed inPatch commit
5.155.15.325.15.222e6cdd2a0470d
4.144.14.2794.159857a75714bb
4.194.19.2434.20cbadf2575d25
5.45.4.1935.5cbc7ec97601d
5.105.10.1095.11fd137bf8149b
5.165.16.185.178c1882dfee8f
5.175.17.15.189b110a9dcecc
6.1—6.1.189—
6.6—6.6.158—
6.12—6.12.111—
6.18—6.18.53—
7.2—7.2.7—
mainline—7.3-rc2—
cip/6.12—6.12.111-cip32cbc7ec97601d