CVE-2026-138865: mm/hugetlb: fix subpool minimum reservation rollback
In the Linux kernel, the following vulnerability has been resolved:
mm/hugetlb: fix subpool minimum reservation rollback
When a reservation request is partially covered by a subpool minimum and the remaining global reservation fails, the error path first calls hugepagesubpoolputpages() for the subpool-backed portion. It removes the failed global portion from usedhpages only afterwards.
hugepagesubpoolputpages() uses usedhpages to decide whether rsvhpages should be restored. Since usedhpages still includes the global portion, it can remain at or above minhpages and prevent that restoration. It then reports the subpool reservation as releasable, causing hugetlbacctmemory() to incorrectly decrement h->resvhugepages.
This was reproduced with four 2 MB huge pages and a hugetlbfs mount with size=10M,minsize=8M. After a successful three-page reservation, a two-page reservation which needed one subpool page and one global page failed with -ENOMEM. HugePagesRsvd incorrectly dropped from four to three even though the subpool minimum was still four pages.
Roll back the failed global portion from usedhpages first, so that hugepagesubpoolputpages() evaluates the minimum reservation against the current usage and returns the correct global adjustment.