CVE-2026-99928: mm/hugetlb: don't clear the resv_map of a VMA whose lock is held

Published Nov 30, 2026
·
Updated

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

mm/hugetlb: don't clear the resvmap of a VMA whose lock is held

Since commit bf4916922c60 ("hugetlbfs: extend hugetlbvmalock to private VMAs") the lock of a private hugetlb VMA that owns a reservation is the rwsema of its resvmap. The hugetlbvmalock() helpers find it through vma->vmprivatedata, anew for every lock and every unlock.

At the end of mremap() the old VMA has to let go of the resvmap, which now belongs to the new VMA: clearvmaresvhugepages() stores NULL into vmprivatedata. mremap() holds mmaplock for writing and has write locked the VMA, which keeps away everybody who comes through the mm. It does not keep away those who find the VMA through the file. For hole punch and truncation hugetlbvmdeletelist() does

hugetlbvmatrylockwrite(vma); locks resvmap->rwsema unmaphugepagerange(vma, ...); vmprivatedata = NULL hugetlbvmaunlockwrite(vma); no resvmap: does nothing

and the rwsema stays write locked for ever:

WARNING: lock held when returning to user space! mremappunch/116 is leaving the kernel with locks still held! locks held by mremappunch/116: 1, last CPU#1: #0: (&resvmap->rwsema){+.+.}-{4:4}, at: hugetlbvmdeletelist+0x46/0x160

The next fault in the new VMA sleeps in hugetlbvmalockread(), uninterruptibly, and it holds its entry of hugetlbfaultmutextable[]. That table is global, so a fault of any other process on a page that hashes to the same entry sleeps uninterruptibly as well.

All those who take the lock of a private VMA without taking the mmap/vma lock are affected: rmap walks. So hold immaprwsem around the clearing of the resvmap.

No change of behaviour, other than that mremap() of a hugetlb VMA takes immaprwsem once more.

Original fix generated by an LLM and sent in private by Josef.

[david: avoid local variable, move and refine comment, description cleanups+simplifications]

Affected Software

1 affected component
Linux Linux kernel

Event History

Nov 30, 2026
CVE Published
via MITRE·01:18 PM
Data Sourced
via MITRE·01:18 PM
Description

Frequently Asked Questions

1

Which workloads are exposed to this issue?

The affected path involves a private hugetlb VMA that owns a reservation and is remapped with mremap(). Exposure requires a concurrent hole-punch or truncation path that locates the VMA through its backing file rather than through the process memory map.

2

What is the observable impact if the race occurs?

The reservation map rw_sema can remain write-locked indefinitely after vm_private_data is cleared. The kernel may report a warning about returning to user space with locks still held.

3

How can I tell whether this has already occurred?

Check kernel warnings for messages indicating that a task is leaving the kernel with locks still held, such as a lock held by an mremap-related task. The diagnostic described for this issue identifies the held lock as the reservation map rw_sema.

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