Vulnerability · Published Oct 21, 2024 · Assigned by Linux

CVE-2024-49964mm/hugetlb: fix memfd_pin_folios free_huge_pages leak

Medium 5.5

In plain English

A medium-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 10% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS NVD)5.5Medium
Exploit odds (30 days)0.2%top 89.8% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:13linux6.11.4-1DEBIAN-CVE-2024-49964
Debian:14linux6.11.4-1DEBIAN-CVE-2024-49964
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-intel-iot-realtimeno fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-49964
Ubuntu:24.04:LTSlinux-oem-6.116.11.0-1015.15UBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2024-49964
Ubuntu:24.04:LTSlinux-raspi-realtimeno fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-49964
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2024-49964

Affected products (as reported)

VendorProductVersions
Linux Linux 89c1905d9c140372b7f50ef48f42378cf85d9bc5 – before 59e081ff2e91bbf19b8c1ecb75b031f77885838389c1905d9c140372b7f50ef48f42378cf85d9bc5 – before c56b6f3d801d7ec8965993342bdd9e2972b6cb8e
Linux Linux 6.11

References