# CVE-2026-138896: mm: hugetlb: return -ENOSPC on memcg charge failure

- 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.22%, higher than 13% of CVEs (2026-12-01)
- Published: 2026-11-30T13:25:59.770Z
- Modified: 2026-11-30T14:17:47.503Z
- Assigned by: Linux

## Description

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

mm: hugetlb: return -ENOSPC on memcg charge failure

Patch series "Fix bugs in HugeTLB allocation when
mem_cgroup_charge_hugetlb() fails", v2.

In hugetlb_alloc_folio(), when mem_cgroup_charge_hugetlb() fails, there
are 2 issues:

1. free_huge_folio() expects a non-refcounted folio and will
   VM_BUG_ON_FOLIO().

2. -ENOMEM is returned, causing an infinite loop retrying the fault.


This patch (of 2):

When mem_cgroup_charge_hugetlb() fails with -ENOMEM, alloc_hugetlb_folio()
currently propagates this error.  This results in the page fault handler
returning VM_FAULT_OOM.

Because HugeTLB allocations are high-order and use __GFP_RETRY_MAYFAIL,
they bypass the OOM killer.  Returning VM_FAULT_OOM to the #PF handler
without triggering the OOM killer (or having it make progress) leads to an
infinite loop of retrying the fault.

Avoid this loop by returning -ENOSPC when charging fails, which maps to
VM_FAULT_SIGBUS, terminating the process cleanly.

Make mem_cgroup_charge_hugetlb() fault handling use a common error
handling path, the same handling used for
hugetlb_cgroup_uncharge_cgroup{,_rsvd}(), which also don't trigger the OOM
killer and hence opt to terminate the process with a SIGBUS.

(As written by CVE List.)

## Affected

- Linux Linux: from 991135774c0e05a4734e6d32aa03b00355e4cac9 before fb4752249623c6ac966a1a94a3f25456c0dfeea0; from 991135774c0e05a4734e6d32aa03b00355e4cac9 before 11afc840288ab10a95b41ce5e298ce415fef0204; from 991135774c0e05a4734e6d32aa03b00355e4cac9 before 956aeff185e7e16b989202bde0bb29859adba99d; 6.14 (not affected: before 6.14; 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/fb4752249623c6ac966a1a94a3f25456c0dfeea0>
- <https://git.kernel.org/stable/c/11afc840288ab10a95b41ce5e298ce415fef0204>
- <https://git.kernel.org/stable/c/956aeff185e7e16b989202bde0bb29859adba99d>

## Sources

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

---

Page: https://cve.day/CVE-2026-138896 · Whole record: https://cve.day/CVE-2026-138896.json · Rebuilt by cve.day 2026-11-30T14:32:31.632Z
