REDHAT-BUG-2576881: Use After Free

Published Nov 19, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

fs/proc/taskmmu: pin mmusers in dopagemapscan()

The PAGEMAPSCAN ioctl takes mmapreadlock() on an mm obtained from /proc/<pid>/pagemap without holding a reference to mmusers.

procmemopen() deliberately grabs only mmcount, so a consumer that touches the address space has to call mmgetnotzero() first. Every other consumer in this file does -- mstart(), doprocmapquery(), showsmapsrollup() and pagemapread() -- but dopagemapscan() does not.

Without that reference the target can reach exitmmap() concurrently, and exitmmap() calls unmapvmas() while holding mmaplock only for reading, which does not exclude the scanner. For ordinary VMAs this is harmless, as freepgtables() and removevma() run afterwards under mmapwritelock. A shared hugetlb VMA is different: hugetlbzapend() frees the VMA's hugetlbvmalock inside the read-locked phase.

walkhugetlbrange() can therefore load vma->vmprivatedata, have the lock freed underneath it, and then downread() a freed rwsemaphore. 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 hugetlbreservepages() allocates the lock before the VMNORESERVE early return.

Pin mmusers across the scan, the way the other consumers do. mmput() from the exiting task can then no longer reach exitmmap() while a walk is in progress.

[akpm: remove unneeded & undesirable test for !mm]

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Operational

    In do_pagemap_scan(), call mmget_not_zero() to pin mm_users before scanning, hold the reference for the duration of the scan, and release it with mmput().

Event History

Nov 19, 2026
Data Sourced
via Red Hat·03:38 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

Which kernel interface is involved in reaching the vulnerable code path?

The affected path is the PAGEMAP_SCAN ioctl used through /proc/<pid>/pagemap. The scanner operates on another process's memory map while that process can concurrently exit its address space.

2

Are all memory mappings equally exposed to the use-after-free condition?

No. The described use-after-free depends on a shared hugetlb VMA, where teardown can free the hugetlb_vma_lock during the read-locked phase. Ordinary VMAs are described as harmless in this race because their relevant cleanup occurs later under mmap_write_lock.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203