mm: hugetlb: return -ENOSPC on memcg charge failure
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| LinuxLinux | — | Not listed |
| LinuxKernel |
≥ 6.14.0, < 6.18.64→ 6.18.64 ≥ 6.19.0, < 7.3.4→ 7.3.4 |
6.18.64 7.3.4 |
Fix status by distribution
Records published by each distribution for this CVE. Fixed versions differ by release; check each link.
- BellSoft Alpaquita BELL-CVE-2026-138896 linux-lts Fix available
- Debian DEBIAN-CVE-2026-138896 linux Fix available
- Ubuntu UBUNTU-CVE-2026-138896 linux-xilinx-zynqmp, linux-xilinx, linux-vmware +166 more No fixed version in this record
Original description The description as published by the source.
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:
-
free_huge_folio() expects a non-refcounted folio and will
VM_BUG_ON_FOLIO(). -
-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.
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- advisory nvd.nist.gov
- package git.kernel.org
- REDHAT Red Hat
- web git.kernel.org
- web git.kernel.org
- web git.kernel.org
- web github.com