CVE-2024-49964: mm/hugetlb: fix memfd_pin_folios free_huge_pages leak
In the Linux kernel, the following vulnerability has been resolved:
mm/hugetlb: fix memfdpinfolios freehugepages leak
memfdpinfolios followed by unpinfolios fails to restore freehugepages if the pages were not already faulted in, because the folio refcount for pages created by memfdallocfolio never goes to 0. memfdpinfolios needs another folioput to undo the foliotryget below:
memfdallocfolio() allochugetlbfolionodemask() dequeuehugetlbfolionodemask() dequeuehugetlbfolionodeexact() foliorefunfreeze(folio, 1); ; adds 1 refcount foliotryget() ; adds 1 refcount hugetlbaddtopagecache() ; adds 512 refcount (on x86)
With the fix, after memfdpinfolios + unpinfolios, the refcount for the (unfaulted) page is 512, which is correct, as the refcount for a faulted unpinned page is 513.
Other sources
This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.
— Launchpad
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-49964?
CVE-2024-49964 is categorized as a medium severity vulnerability due to its potential impact on memory management within the Linux kernel.
How do I fix CVE-2024-49964?
To fix CVE-2024-49964, update your Linux kernel to a version that includes the patch, typically 6.11.3 or newer.
Which versions of the Linux kernel are affected by CVE-2024-49964?
CVE-2024-49964 affects Linux kernel versions from 6.11.0 to 6.11.2.
Is CVE-2024-49964 a remote vulnerability?
CVE-2024-49964 is not classified as a remote vulnerability, as it pertains to local memory management issues.
What systems are impacted by CVE-2024-49964?
CVE-2024-49964 impacts systems running affected versions of the Linux kernel, particularly those using Debian-based distributions.