CVE-2026-99477 in Linux
Summary
by MITRE • 11/19/2026
In the Linux kernel, the following vulnerability has been resolved:
fs/proc/task_mmu: pin mm_users in do_pagemap_scan()
The PAGEMAP_SCAN ioctl takes mmap_read_lock() on an mm obtained from /proc/<pid>/pagemap without holding a reference to mm_users.
proc_mem_open() deliberately grabs only mm_count, so a consumer that touches the address space has to call mmget_not_zero() first. Every other consumer in this file does -- m_start(), do_procmap_query(), show_smaps_rollup() and pagemap_read() -- but do_pagemap_scan() does not.
Without that reference the target can reach exit_mmap() concurrently, and exit_mmap() calls unmap_vmas() while holding mmap_lock only for reading, which does not exclude the scanner. For ordinary VMAs this is harmless, as free_pgtables() and remove_vma() run afterwards under mmap_write_lock. A shared hugetlb VMA is different: __hugetlb_zap_end() frees the VMA's hugetlb_vma_lock inside the read-locked phase.
walk_hugetlb_range() can therefore load vma->vm_private_data, have the lock freed underneath it, and then down_read() a freed rw_semaphore. The load happens before the freeing side clears the pointer, so this is a use-after-free and not a NULL dereference. Any unprivileged user can reach it with no huge pages configured, as hugetlb_reserve_pages() allocates the lock before the VM_NORESERVE early return.
Pin mm_users across the scan, the way the other consumers do. mmput() from the exiting task can then no longer reach exit_mmap() while a walk is in progress.
[[email protected]: remove unneeded & undesirable test for !mm]
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 11/19/2026
The Linux kernel vulnerability identified involves a race condition within the proc filesystem implementation, specifically affecting the do_pagemap_scan function which handles the PAGEMAP_SCAN ioctl interface. This interface allows user-space applications to scan the memory map of another process by accessing /proc/<pid>/pagemat. The core technical flaw stems from an inconsistency in reference counting management for the mm_struct structure associated with the target task's address space. While other consumers within this file, such as m_start, do_procmap_query, show_smaps_rollup, and pagemap_read, correctly invoke mmget_not_zero to increment the mm_users count before accessing the memory map, do_pagemap_scan fails to perform this operation. The proc_mem_open function deliberately acquires only a reference to mm_count rather than mm_users, placing the responsibility on consumers that touch the address space to ensure stability by calling mmget_not_zero first. By omitting this critical step, the scanner leaves itself vulnerable to concurrent modifications of the target process's memory layout.
The operational impact of this oversight is severe due to the potential for a use-after-free condition leading to kernel instability or privilege escalation. When do_pagemap_scan operates without holding an mm_users reference, it does not prevent the target task from reaching exit_mmap concurrently. During the execution of exit_mmap, the function unmap_vmas while holding only a read lock on mmap_lock. This read-level locking is insufficient to exclude the scanner because ordinary virtual memory areas are handled safely by subsequent operations under write locks. However, shared huge pages present a distinct risk profile. Within the hugetlb subsystem, __hugetlb_zap_end frees the vma->vm_private_data pointer inside the read-locked phase of unmap_vmas. Consequently, walk_huletb_range can load this private data pointer before it is cleared by the freeing side, and subsequently attempt to down_read on a freed rw_semaphore object. This sequence constitutes a classic use-after-free vulnerability where memory previously allocated for synchronization primitives is accessed after being released back to the system.
This vulnerability is particularly concerning because it allows any unprivileged user to trigger the flaw without requiring huge pages to be configured in the kernel. The hugetlb_reserve_pages function allocates the necessary lock structures before encountering an early return condition related to VM_NORESERVE, ensuring that the race window exists regardless of specific hardware or configuration settings. An attacker exploiting this use-after-free could potentially achieve arbitrary code execution by manipulating the freed memory contents or causing a kernel panic through invalid semaphore operations. The fix involves pinning mm_users across the duration of the scan operation, mirroring the behavior of other consumers in the same file. This ensures that mmput calls from an exiting task cannot reach exit_mmap while a page map walk is actively in progress, thereby maintaining structural integrity during concurrent access scenarios.
From a classification perspective, this vulnerability aligns with CWE-416 Use After Free and CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization. The exploitation vector relates to ATT&CK technique T1059 Command and Scripting Interpreter if the resulting kernel crash is leveraged for denial of service, or potentially T1068 Exploitation for Privilege Escalation if an attacker successfully crafts a payload against the freed memory structure. Mitigation strategies primarily involve applying the upstream Linux kernel patch that enforces proper reference counting via mmget_not_zero in do_pagemap_scan. System administrators should ensure their systems are updated with the latest stable kernel versions containing this fix. Additionally, monitoring for unusual patterns of /proc/pid access combined with rapid process creation and termination may help detect attempted exploitation activities in monitored environments until patches are deployed.