{"id":"CVE-2026-138868","aliases":["CVE-2026-138868"],"related":[],"kind":"vulnerability","state":"published","title":"mm/hugetlb: charge folios to the target mm's memcg","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/hugetlb: charge folios to the target mm's memcg\n\nHugeTLB folios are currently charged to the memcg of the allocating task. \nThis gives the wrong result when a userfaultfd handler populates a HugeTLB\nVMA that belongs to another process.  The UFFDIO_COPY ioctl operates on\nthe userfaultfd context's mm, but get_mem_cgroup_from_current() charges\nthe folio to the handler's memcg instead.\n\nThis can be reproduced by placing the faulting process and its userfaultfd\nhandler in different memory cgroups.  Have the target process register a\nHugeTLB mapping with userfaultfd, trigger a missing fault, and let the\nhandler resolve it with UFFDIO_COPY.  The hugepage usage is then reported\nin the handler's memory.current instead of the target's.\n\nThe generic userfaultfd population path avoids this problem by charging\nfolios to dst_vma->vm_mm.\n\nPass the target mm through hugetlb_alloc_folio() and charge the folio by\nusing get_mem_cgroup_from_mm().  This preserves the existing charge timing\nand error handling while making HugeTLB userfaultfd population consistent\nwith the generic path.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/hugetlb: charge folios to the target mm's memcg\n\nHugeTLB folios are currently charged to the memcg of the allocating task. \nThis gives the wrong result when a userfaultfd handler populates a HugeTLB\nVMA that belongs to another process.  The UFFDIO_COPY ioctl operates on\nthe userfaultfd context's mm, but get_mem_cgroup_from_current() charges\nthe folio to the handler's memcg instead.\n\nThis can be reproduced by placing the faulting process and its userfaultfd\nhandler in different memory cgroups.  Have the target process register a\nHugeTLB mapping with userfaultfd, trigger a missing fault, and let the\nhandler resolve it with UFFDIO_COPY.  The hugepage usage is then reported\nin the handler's memory.current instead of the target's.\n\nThe generic userfaultfd population path avoids this problem by charging\nfolios to dst_vma->vm_mm.\n\nPass the target mm through hugetlb_alloc_folio() and charge the folio by\nusing get_mem_cgroup_from_mm().  This preserves the existing charge timing\nand error handling while making HugeTLB userfaultfd population consistent\nwith the generic path.","source":"cvelist"}],"published":"2026-11-30T13:25:44.333Z","modified":"2026-11-30T14:17:43.450Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"8cba9576df601c384abd334a503c3f6e1e29eefb","fixed":"d0497a8491ebe5e8f8b53236e24adb3e9c9c5bd3","status":"affected"},{"type":"git","introduced":"8cba9576df601c384abd334a503c3f6e1e29eefb","fixed":"0744fbc37eba382754056844253da10d3702babb","status":"affected"},{"type":"git","introduced":"8cba9576df601c384abd334a503c3f6e1e29eefb","fixed":"ce8381ddd3877529d28b42b11b43ed214b0f5452","status":"affected"},{"type":"git","introduced":"8cba9576df601c384abd334a503c3f6e1e29eefb","fixed":"c2deb1356d82c9d54bd2fcf1241cc97eb66fd81f","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.7","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.7","status":"unaffected"},{"type":"semver","introduced":"6.12.118","lastAffected":"6.12.*","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/d0497a8491ebe5e8f8b53236e24adb3e9c9c5bd3","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0744fbc37eba382754056844253da10d3702babb","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ce8381ddd3877529d28b42b11b43ed214b0f5452","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c2deb1356d82c9d54bd2fcf1241cc97eb66fd81f","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-138868","url":"https://www.cve.org/CVERecord?id=CVE-2026-138868","licence":"CVE Terms of Use","modified":"2026-11-30T13:25:44.333Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-138868","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138868","licence":"Public domain","modified":"2026-11-30T14:17:43.450Z"}],"updatedAt":"2026-11-30T14:32:28.624Z","epss":{"score":0.00209,"percentile":0.11751,"date":"2026-12-01T12:00:22.000Z"}}