CVE-2024-49964

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-49964
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-49964.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-49964
Downstream
Related
Published
2024-10-21T18:02:15Z
Modified
2025-10-09T19:53:40.962549Z
Summary
mm/hugetlb: fix memfd_pin_folios free_huge_pages leak
Details

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 + unpin_folios, the refcount for the (unfaulted) page is 512, which is correct, as the refcount for a faulted unpinned page is 513.

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
89c1905d9c140372b7f50ef48f42378cf85d9bc5
Fixed
59e081ff2e91bbf19b8c1ecb75b031f778858383
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
89c1905d9c140372b7f50ef48f42378cf85d9bc5
Fixed
c56b6f3d801d7ec8965993342bdd9e2972b6cb8e

Affected versions

v6.*

v6.10
v6.10-rc7
v6.11
v6.11-rc1
v6.11-rc2
v6.11-rc3
v6.11-rc4
v6.11-rc5
v6.11-rc6
v6.11-rc7
v6.11.1
v6.11.2

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.11.0
Fixed
6.11.3