# CVE-2026-99923: mm/memfd: fix hugetlb reservation accounting in error paths

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.31%, higher than 25% of CVEs (2026-12-01)
- Published: 2026-11-30T13:18:19.011Z
- Modified: 2026-11-30T14:20:28.587Z
- Assigned by: Linux

## Description

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

mm/memfd: fix hugetlb reservation accounting in error paths

If hugetlb_add_to_page_cache() in memfd_alloc_folio() fails with -EEXIST,
a concurrent fault has already instantiated the folio in the page cache,
and the reservation now belongs to that folio.  Calling
hugetlb_unreserve_pages() in that case incorrectly removes the region
backing the cached folio and releases one reservation more than it should,
leaving that folio in the page cache with no region recording it.

That leaves resv_huge_pages one page short until that folio is removed
from the page cache, so available_huge_pages() reports a page that is not
actually free and the pool can grant one reservation more than it can
back.  Applications using hugetlb memfds can then fail to allocate or
fault in a page they already reserved.  They see -ENOMEM or -ENOSPC from
the allocation or fault path even though the reservation and
HugePages_Free still look healthy.

So hold the hugetlb fault mutex from hugetlb_reserve_pages() until the
error-path unreserve completes to make the reserve, allocate and
instantiate steps atomic against concurrent faults.  With the mutex held
from the start, a concurrent fault can no longer consume the reservation
between reserve and allocate/instantiate.  If a fault completed before the
mutex was taken, it has already added the region for that index, so
hugetlb_reserve_pages() returns 0 and the error path leaves the region in
place.

(As written by CVE List.)

## Affected

- Linux Linux: from 717cf9357325055ab6b41c4e0581f4d67601eb58 before ef619ce17a4a0f5f85649ced1ce96fe53737e4f3; from 717cf9357325055ab6b41c4e0581f4d67601eb58 before 90f2f099e69bfb341c714751369c36cf3a420f6c; from 717cf9357325055ab6b41c4e0581f4d67601eb58 before 50ee565c1e900e247e439e4139839b060c968343; 6.17 (not affected: before 6.17; from 6.18.64 up to 6.18.*; from 7.3.4 up to 7.3.*; from 7.4-rc1 up to *)

## References

- <https://git.kernel.org/stable/c/ef619ce17a4a0f5f85649ced1ce96fe53737e4f3>
- <https://git.kernel.org/stable/c/90f2f099e69bfb341c714751369c36cf3a420f6c>
- <https://git.kernel.org/stable/c/50ee565c1e900e247e439e4139839b060c968343>

## Sources

- CVE List: [CVE-2026-99923](https://www.cve.org/CVERecord?id=CVE-2026-99923), CVE Terms of Use, modified 2026-11-30
- NVD: [CVE-2026-99923](https://nvd.nist.gov/vuln/detail/CVE-2026-99923), Public domain, modified 2026-11-30

---

Page: https://cve.day/CVE-2026-99923 · Whole record: https://cve.day/CVE-2026-99923.json · Rebuilt by cve.day 2026-11-30T14:33:33.169Z
