CVE-2024-49964
JSON

5.5medium

mm/hugetlb: fix memfd_pin_folios free_huge_pages leak

Severity
5.5medium CVSS:3.1 by NVD
Exploit likelihood
0.20% (higher than 10% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

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

Product or packageVersionsReported by
Linux Linuxfrom 89c1905d9c140372b7f50ef48f42378cf85d9bc5 before 59e081ff2e91bbf19b8c1ecb75b031f778858383, from 89c1905d9c140372b7f50ef48f42378cf85d9bc5 before c56b6f3d801d7ec8965993342bdd9e2972b6cb8e, 6.11
Not affected: before 6.11, from 6.11.3 up to 6.11.*, from 6.12 up to *
CVE List
linux linux_kernelfrom 6.11 before 6.11.3NVD

Classification

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: mm/hugetlb: se corrige la fuga de free_huge_pages de memfd_pin_folios memfd_pin_folios seguido de unpin_folios no puede restaurar free_huge_pages si las páginas no tenían ya un error, porque el recuento de referencias de folio para las páginas creadas por memfd_alloc_folio nunca llega a 0. memfd_pin_folios necesita otro folio_put para deshacer el folio_try_get a continuación: memfd_alloc_folio() alloc_hugetlb_folio_nodemask() dequeue_hugetlb_folio_nodemask() dequeue_hugetlb_folio_node_exact() folio_ref_unfreeze(folio, 1); ; agrega 1 recuento de referencias folio_try_get() ; agrega 1 recuento de referencias hugetlb_add_to_page_cache() ; agrega 512 refcount (en x86) Con la solución, después de memfd_pin_folios + unpin_folios, el refcount para la página (sin fallos) es 512, lo cual es correcto, ya que el refcount para una página sin fijar con fallos es 513.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-49964 changed 2026-05-11CVE Terms of Use
NVDCVE-2024-49964 changed 2026-06-17Public domain