CVE-2026-138868

mm/hugetlb: charge folios to the target mm's memcg

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

mm/hugetlb: charge folios to the target mm's memcg

HugeTLB folios are currently charged to the memcg of the allocating task.
This gives the wrong result when a userfaultfd handler populates a HugeTLB
VMA that belongs to another process. The UFFDIO_COPY ioctl operates on
the userfaultfd context's mm, but get_mem_cgroup_from_current() charges
the folio to the handler's memcg instead.

This can be reproduced by placing the faulting process and its userfaultfd
handler in different memory cgroups. Have the target process register a
HugeTLB mapping with userfaultfd, trigger a missing fault, and let the
handler resolve it with UFFDIO_COPY. The hugepage usage is then reported
in the handler's memory.current instead of the target's.

The generic userfaultfd population path avoids this problem by charging
folios to dst_vma->vm_mm.

Pass the target mm through hugetlb_alloc_folio() and charge the folio by
using get_mem_cgroup_from_mm(). This preserves the existing charge timing
and error handling while making HugeTLB userfaultfd population consistent
with the generic path.

Analysis

AI-generated

Technical impact

The vulnerability stems from an incorrect memory cgroup charge for HugeTLB folios in the Linux kernel. When a userfaultfd handler resolves a fault for a HugeTLB mapping that belongs to another process, the folio is incorrectly charged to the handler’s memory cgroup rather than to the target’s. This mis‑accounting can cause memory limits imposed on cgroups to be bypassed, potentially allowing a process to consume more memory than allowed and destabilize system resources.

Affected Systems

All supported releases of the Linux kernel are affected, as the issue is tied to the generic userfaultfd handling path for HugeTLB memory. The exact affected versions are not listed in the advisory; therefore any kernel that has not yet incorporated the described patch is susceptible.

Risk and Exploitability

No EPSS score is available and the flaw is not listed in the CISA KEV catalog, indicating that no public exploitation data is known. However, the flaw is exploitable by an attacker who can create or control a userfaultfd handler in a different memory cgroup from the target process, optionally using the UFFDIO_COPY ioctl to trigger the miscredit. The lack of an available EPSS score and absence from KEV suggest a lower public exploitation probability, but the impact remains significant due to the potential for memory limit bypass and denial of service. The CVSS score is not provided, so the precise severity is uncertain, yet the described behavior warrants prompt remediation.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a version that includes the patch correcting HugeTLB folio memory cgroup charging.
  • Avoid using userfaultfd to populate HugeTLB mappings for processes that reside in separate memory cgroups; if possible, keep the faulting process and its handler within the same cgroup.
  • Implement monitoring of memory usage per cgroup to detect any anomalous increases that could indicate mis‑accounting.

Generated by OpenCVE AI on November 30, 2026 at 17:02 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Linux linux
Vendors & Products Linux linux
Type Values Removed Values Added
Weaknesses CWE-674
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: mm/hugetlb: charge folios to the target mm's memcg HugeTLB folios are currently charged to the memcg of the allocating task. This gives the wrong result when a userfaultfd handler populates a HugeTLB VMA that belongs to another process. The UFFDIO_COPY ioctl operates on the userfaultfd context's mm, but get_mem_cgroup_from_current() charges the folio to the handler's memcg instead. This can be reproduced by placing the faulting process and its userfaultfd handler in different memory cgroups. Have the target process register a HugeTLB mapping with userfaultfd, trigger a missing fault, and let the handler resolve it with UFFDIO_COPY. The hugepage usage is then reported in the handler's memory.current instead of the target's. The generic userfaultfd population path avoids this problem by charging folios to dst_vma->vm_mm. Pass the target mm through hugetlb_alloc_folio() and charge the folio by using get_mem_cgroup_from_mm(). This preserves the existing charge timing and error handling while making HugeTLB userfaultfd population consistent with the generic path.
Title mm/hugetlb: charge folios to the target mm's memcg
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:25 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:17 PM
Modified
Nov 30, 2026, 2:17 PM