{"id":"CVE-2026-99923","aliases":["CVE-2026-99923"],"related":[],"kind":"vulnerability","state":"published","title":"mm/memfd: fix hugetlb reservation accounting in error paths","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/memfd: fix hugetlb reservation accounting in error paths\n\nIf hugetlb_add_to_page_cache() in memfd_alloc_folio() fails with -EEXIST,\na concurrent fault has already instantiated the folio in the page cache,\nand the reservation now belongs to that folio.  Calling\nhugetlb_unreserve_pages() in that case incorrectly removes the region\nbacking the cached folio and releases one reservation more than it should,\nleaving that folio in the page cache with no region recording it.\n\nThat leaves resv_huge_pages one page short until that folio is removed\nfrom the page cache, so available_huge_pages() reports a page that is not\nactually free and the pool can grant one reservation more than it can\nback.  Applications using hugetlb memfds can then fail to allocate or\nfault in a page they already reserved.  They see -ENOMEM or -ENOSPC from\nthe allocation or fault path even though the reservation and\nHugePages_Free still look healthy.\n\nSo hold the hugetlb fault mutex from hugetlb_reserve_pages() until the\nerror-path unreserve completes to make the reserve, allocate and\ninstantiate steps atomic against concurrent faults.  With the mutex held\nfrom the start, a concurrent fault can no longer consume the reservation\nbetween reserve and allocate/instantiate.  If a fault completed before the\nmutex was taken, it has already added the region for that index, so\nhugetlb_reserve_pages() returns 0 and the error path leaves the region in\nplace.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/memfd: fix hugetlb reservation accounting in error paths\n\nIf hugetlb_add_to_page_cache() in memfd_alloc_folio() fails with -EEXIST,\na concurrent fault has already instantiated the folio in the page cache,\nand the reservation now belongs to that folio.  Calling\nhugetlb_unreserve_pages() in that case incorrectly removes the region\nbacking the cached folio and releases one reservation more than it should,\nleaving that folio in the page cache with no region recording it.\n\nThat leaves resv_huge_pages one page short until that folio is removed\nfrom the page cache, so available_huge_pages() reports a page that is not\nactually free and the pool can grant one reservation more than it can\nback.  Applications using hugetlb memfds can then fail to allocate or\nfault in a page they already reserved.  They see -ENOMEM or -ENOSPC from\nthe allocation or fault path even though the reservation and\nHugePages_Free still look healthy.\n\nSo hold the hugetlb fault mutex from hugetlb_reserve_pages() until the\nerror-path unreserve completes to make the reserve, allocate and\ninstantiate steps atomic against concurrent faults.  With the mutex held\nfrom the start, a concurrent fault can no longer consume the reservation\nbetween reserve and allocate/instantiate.  If a fault completed before the\nmutex was taken, it has already added the region for that index, so\nhugetlb_reserve_pages() returns 0 and the error path leaves the region in\nplace.","source":"cvelist"}],"published":"2026-11-30T13:18:19.011Z","modified":"2026-11-30T14:20:28.587Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"717cf9357325055ab6b41c4e0581f4d67601eb58","fixed":"ef619ce17a4a0f5f85649ced1ce96fe53737e4f3","status":"affected"},{"type":"git","introduced":"717cf9357325055ab6b41c4e0581f4d67601eb58","fixed":"90f2f099e69bfb341c714751369c36cf3a420f6c","status":"affected"},{"type":"git","introduced":"717cf9357325055ab6b41c4e0581f4d67601eb58","fixed":"50ee565c1e900e247e439e4139839b060c968343","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.17","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.17","status":"unaffected"},{"type":"semver","introduced":"6.18.64","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.4","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/ef619ce17a4a0f5f85649ced1ce96fe53737e4f3","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/90f2f099e69bfb341c714751369c36cf3a420f6c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/50ee565c1e900e247e439e4139839b060c968343","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-99923","url":"https://www.cve.org/CVERecord?id=CVE-2026-99923","licence":"CVE Terms of Use","modified":"2026-11-30T13:18:19.011Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-99923","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99923","licence":"Public domain","modified":"2026-11-30T14:20:28.587Z"}],"updatedAt":"2026-11-30T14:33:33.169Z","epss":{"score":0.00306,"percentile":0.25183,"date":"2026-12-01T12:00:22.000Z"}}