CVE-2024-49964

mm/hugetlb: fix memfd_pin_folios free_huge_pages leak

State
Published
Severity
Not scored
Published
Oct 21, 2024
Updated
May 11, 2026
Reserved
Oct 21, 2024

Read the record on cve.org

Description

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

mm/hugetlb: fix memfd_pin_folios free_huge_pages leak

memfd_pin_folios followed by unpin_folios fails to restore free_huge_pages if the pages were not already faulted in, because the folio refcount for pages created by memfd_alloc_folio never goes to 0. memfd_pin_folios needs another folio_put to undo the folio_try_get below:

memfd_alloc_folio() alloc_hugetlb_folio_nodemask() dequeue_hugetlb_folio_nodemask() dequeue_hugetlb_folio_node_exact() folio_ref_unfreeze(folio, 1); ; adds 1 refcount folio_try_get() ; adds 1 refcount hugetlb_add_to_page_cache() ; adds 512 refcount (on x86)

With the fix, after memfd_pin_folios + unpin_folios, the refcount for the (unfaulted) page is 512, which is correct, as the refcount for a faulted unpinned page is 513.

Scores

The record has no CVSS score.

Weaknesses

The record names no weakness.

Affected Products

ProductVersions
LinuxLinux
  • 89c1905d9c140372b7f50ef48f42378cf85d9bc5 to before 59e081ff2e91bbf19b8c1ecb75b031f778858383Affected
  • 89c1905d9c140372b7f50ef48f42378cf85d9bc5 to before c56b6f3d801d7ec8965993342bdd9e2972b6cb8eAffected
LinuxLinux
  • 6.11Affected
  • before 6.11Not affected
  • 6.11.3 through 6.11.*Not affected
  • 6.12 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.