CVE-2026-138895: mm: hugetlb: drop refcount before freeing on memcg charge failure

Published Nov 30, 2026
·
Updated

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

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

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

The error path calls freehugefolio(folio) directly, which expects a refcount of 0. Hence, VMBUGONFOLIO(foliorefcount(folio), folio) is triggered.

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

Use folioput(folio) instead of freehugefolio(folio) to properly drop the reference before freeing it.

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    On the mem_cgroup_charge_hugetlb(folio, gfp) -ENOMEM error path, use folio_put(folio) instead of free_huge_folio(folio) to drop the reference before freeing the folio.

Event History

Nov 30, 2026
CVE Published
via MITRE·01:25 PM
Data Sourced
via MITRE·01:25 PM
Description
Data Sourced
via NVD·02:17 PM
Description

Frequently Asked Questions

1

What condition is required to trigger the faulty error path?

The hugetlb memory-cgroup charge for a folio must fail with -ENOMEM. In that case, the folio has been restored to a reference count of 1 before the error path attempts to free it.

2

Is this issue limited to kernels built with CONFIG_DEBUG_VM?

No. With CONFIG_DEBUG_VM enabled, the invalid nonzero reference count triggers VM_BUG_ON_FOLIO. Without it, the folio can be returned to the freelist with a reference count of 1, potentially corrupting allocator state later.

3

What does the resolved change do?

It replaces the direct free_huge_folio(folio) call in this error path with folio_put(folio). This drops the restored reference before the folio is freed.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203