CVE-2026-138895

Source
https://cve.org/CVERecord?id=CVE-2026-138895
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138895.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-138895
Downstream
Published
2026-11-30T13:25:59Z
Modified
2026-11-30T15:01:20Z
Summary
mm: hugetlb: drop refcount before freeing on memcg charge failure
Details

In the Linux kernel, the following vulnerability has been resolved:

mm: hugetlb: drop refcount before freeing on memcg charge failure

When mem_cgroup_charge_hugetlb(folio, gfp) returns -ENOMEM, the folio has its refcount set to 1 via folio_ref_unfreeze(folio, 1).

The error path calls free_huge_folio(folio) directly, which expects a refcount of 0. Hence, VM_BUG_ON_FOLIO(folio_ref_count(folio), folio) is triggered.

Even with CONFIG_DEBUG_VM disabled, returning a folio with refcount 1 to the freelist can corrupt allocator state later.

Use folio_put(folio) instead of free_huge_folio(folio) to properly drop the reference before freeing it.

Database specific
{
    "cna_assigner":  "Linux",
    "osv_generated_from":  "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138895.json"
}
References

Affected packages

Git / 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"

Linux / Kernel

Package

Name
Kernel

Affected 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"