{"id":"CVE-2026-138895","summary":"mm: hugetlb: drop refcount before freeing on memcg charge failure","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm: hugetlb: drop refcount before freeing on memcg charge failure\n\nWhen mem_cgroup_charge_hugetlb(folio, gfp) returns -ENOMEM, the folio has\nits refcount set to 1 via folio_ref_unfreeze(folio, 1).\n\nThe error path calls free_huge_folio(folio) directly, which expects a\nrefcount of 0.  Hence, VM_BUG_ON_FOLIO(folio_ref_count(folio), folio) is\ntriggered.\n\nEven with CONFIG_DEBUG_VM disabled, returning a folio with refcount 1 to\nthe freelist can corrupt allocator state later.\n\nUse folio_put(folio) instead of free_huge_folio(folio) to properly drop\nthe reference before freeing it.","modified":"2026-12-01T21:02:35.178177131Z","published":"2026-11-30T13:25:59.224Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138895.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/3f87063217efc3b0198e49ec1a9b262ff81ac406"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e95d29c5df84f19881cd30b491fc81aa98f44b45"},{"type":"WEB","url":"https://git.kernel.org/stable/c/eeb9425606f386f726b47ee323687ee02c7b34f8"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138895.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138895"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"991135774c0e05a4734e6d32aa03b00355e4cac9"},{"fixed":"eeb9425606f386f726b47ee323687ee02c7b34f8"},{"fixed":"3f87063217efc3b0198e49ec1a9b262ff81ac406"},{"fixed":"e95d29c5df84f19881cd30b491fc81aa98f44b45"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138895.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.14.0"},{"fixed":"6.18.64"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138895.json"}}],"schema_version":"1.9.2"}