{"id":"CVE-2026-99477","aliases":["CVE-2026-99477"],"related":[],"kind":"vulnerability","state":"published","title":"fs/proc/task_mmu: pin mm_users in do_pagemap_scan()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs/proc/task_mmu: pin mm_users in do_pagemap_scan()\n\nThe PAGEMAP_SCAN ioctl takes mmap_read_lock() on an mm obtained from\n/proc/<pid>/pagemap without holding a reference to mm_users.\n\nproc_mem_open() deliberately grabs only mm_count, so a consumer that\ntouches the address space has to call mmget_not_zero() first.  Every other\nconsumer in this file does -- m_start(), do_procmap_query(),\nshow_smaps_rollup() and pagemap_read() -- but do_pagemap_scan() does not.\n\nWithout that reference the target can reach exit_mmap() concurrently, and\nexit_mmap() calls unmap_vmas() while holding mmap_lock only for reading,\nwhich does not exclude the scanner.  For ordinary VMAs this is harmless,\nas free_pgtables() and remove_vma() run afterwards under mmap_write_lock. \nA shared hugetlb VMA is different: __hugetlb_zap_end() frees the VMA's\nhugetlb_vma_lock inside the read-locked phase.\n\nwalk_hugetlb_range() can therefore load vma->vm_private_data, have the\nlock freed underneath it, and then down_read() a freed rw_semaphore.  The\nload happens before the freeing side clears the pointer, so this is a\nuse-after-free and not a NULL dereference.  Any unprivileged user can\nreach it with no huge pages configured, as hugetlb_reserve_pages()\nallocates the lock before the VM_NORESERVE early return.\n\nPin mm_users across the scan, the way the other consumers do.  mmput()\nfrom the exiting task can then no longer reach exit_mmap() while a walk is\nin progress.\n\n[akpm@linux-foundation.org: remove unneeded & undesirable test for !mm]","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs/proc/task_mmu: pin mm_users in do_pagemap_scan()\n\nThe PAGEMAP_SCAN ioctl takes mmap_read_lock() on an mm obtained from\n/proc/<pid>/pagemap without holding a reference to mm_users.\n\nproc_mem_open() deliberately grabs only mm_count, so a consumer that\ntouches the address space has to call mmget_not_zero() first.  Every other\nconsumer in this file does -- m_start(), do_procmap_query(),\nshow_smaps_rollup() and pagemap_read() -- but do_pagemap_scan() does not.\n\nWithout that reference the target can reach exit_mmap() concurrently, and\nexit_mmap() calls unmap_vmas() while holding mmap_lock only for reading,\nwhich does not exclude the scanner.  For ordinary VMAs this is harmless,\nas free_pgtables() and remove_vma() run afterwards under mmap_write_lock. \nA shared hugetlb VMA is different: __hugetlb_zap_end() frees the VMA's\nhugetlb_vma_lock inside the read-locked phase.\n\nwalk_hugetlb_range() can therefore load vma->vm_private_data, have the\nlock freed underneath it, and then down_read() a freed rw_semaphore.  The\nload happens before the freeing side clears the pointer, so this is a\nuse-after-free and not a NULL dereference.  Any unprivileged user can\nreach it with no huge pages configured, as hugetlb_reserve_pages()\nallocates the lock before the VM_NORESERVE early return.\n\nPin mm_users across the scan, the way the other consumers do.  mmput()\nfrom the exiting task can then no longer reach exit_mmap() while a walk is\nin progress.\n\n[akpm@linux-foundation.org: remove unneeded & undesirable test for !mm]","source":"cvelist"}],"published":"2026-11-19T14:43:11.195Z","modified":"2026-11-22T11:16:53.720Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"52526ca7fdb905a768a93f8faa418e9b988fc34b","fixed":"6e2299a9356de3364e193d6eaf123b90d7698c1d","status":"affected"},{"type":"git","introduced":"52526ca7fdb905a768a93f8faa418e9b988fc34b","fixed":"abc9c0f4f850d23e55f4230cd0f54938a64267bf","status":"affected"},{"type":"git","introduced":"52526ca7fdb905a768a93f8faa418e9b988fc34b","fixed":"14a853bf3e6f0dd62ff479a36613411237dec24c","status":"affected"},{"type":"git","introduced":"52526ca7fdb905a768a93f8faa418e9b988fc34b","fixed":"4fb975471717c953f912776bb60301add1ffae11","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.7","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.7","status":"unaffected"},{"type":"semver","introduced":"6.12.117","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.61","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.2","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/6e2299a9356de3364e193d6eaf123b90d7698c1d","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/abc9c0f4f850d23e55f4230cd0f54938a64267bf","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/14a853bf3e6f0dd62ff479a36613411237dec24c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/4fb975471717c953f912776bb60301add1ffae11","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-99477","url":"https://www.cve.org/CVERecord?id=CVE-2026-99477","licence":"CVE Terms of Use","modified":"2026-11-22T11:08:33.584Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-99477","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99477","licence":"Public domain","modified":"2026-11-22T11:16:53.720Z"}],"updatedAt":"2026-11-25T22:59:52.086Z","epss":{"score":0.00225,"percentile":0.1406,"date":"2026-12-01T12:00:22.000Z"}}