# CVE-2026-138868: mm/hugetlb: charge folios to the target mm's memcg

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

## 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.

(As written by CVE List.)

## Affected

- Linux Linux: from 8cba9576df601c384abd334a503c3f6e1e29eefb before d0497a8491ebe5e8f8b53236e24adb3e9c9c5bd3; from 8cba9576df601c384abd334a503c3f6e1e29eefb before 0744fbc37eba382754056844253da10d3702babb; from 8cba9576df601c384abd334a503c3f6e1e29eefb before ce8381ddd3877529d28b42b11b43ed214b0f5452; from 8cba9576df601c384abd334a503c3f6e1e29eefb before c2deb1356d82c9d54bd2fcf1241cc97eb66fd81f; 6.7 (not affected: before 6.7; from 6.12.118 up to 6.12.*; 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/d0497a8491ebe5e8f8b53236e24adb3e9c9c5bd3>
- <https://git.kernel.org/stable/c/0744fbc37eba382754056844253da10d3702babb>
- <https://git.kernel.org/stable/c/ce8381ddd3877529d28b42b11b43ed214b0f5452>
- <https://git.kernel.org/stable/c/c2deb1356d82c9d54bd2fcf1241cc97eb66fd81f>

## Sources

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

---

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