{"id":"CVE-2024-49964","aliases":["CVE-2024-49964"],"related":[],"kind":"vulnerability","state":"published","title":"mm/hugetlb: fix memfd_pin_folios free_huge_pages leak","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/hugetlb: fix memfd_pin_folios free_huge_pages leak\n\nmemfd_pin_folios followed by unpin_folios fails to restore free_huge_pages\nif the pages were not already faulted in, because the folio refcount for\npages created by memfd_alloc_folio never goes to 0.  memfd_pin_folios\nneeds another folio_put to undo the folio_try_get below:\n\nmemfd_alloc_folio()\n  alloc_hugetlb_folio_nodemask()\n    dequeue_hugetlb_folio_nodemask()\n      dequeue_hugetlb_folio_node_exact()\n        folio_ref_unfreeze(folio, 1);    ; adds 1 refcount\n  folio_try_get()                        ; adds 1 refcount\n  hugetlb_add_to_page_cache()            ; adds 512 refcount (on x86)\n\nWith the fix, after memfd_pin_folios + unpin_folios, the refcount for the\n(unfaulted) page is 512, which is correct, as the refcount for a faulted\nunpinned page is 513.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/hugetlb: fix memfd_pin_folios free_huge_pages leak\n\nmemfd_pin_folios followed by unpin_folios fails to restore free_huge_pages\nif the pages were not already faulted in, because the folio refcount for\npages created by memfd_alloc_folio never goes to 0.  memfd_pin_folios\nneeds another folio_put to undo the folio_try_get below:\n\nmemfd_alloc_folio()\n  alloc_hugetlb_folio_nodemask()\n    dequeue_hugetlb_folio_nodemask()\n      dequeue_hugetlb_folio_node_exact()\n        folio_ref_unfreeze(folio, 1);    ; adds 1 refcount\n  folio_try_get()                        ; adds 1 refcount\n  hugetlb_add_to_page_cache()            ; adds 512 refcount (on x86)\n\nWith the fix, after memfd_pin_folios + unpin_folios, the refcount for the\n(unfaulted) page is 512, which is correct, as the refcount for a faulted\nunpinned page is 513.","source":"cvelist"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2024-10-21T18:02:15.755Z","modified":"2026-06-17T08:00:50.413Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"89c1905d9c140372b7f50ef48f42378cf85d9bc5","fixed":"59e081ff2e91bbf19b8c1ecb75b031f778858383","status":"affected"},{"type":"git","introduced":"89c1905d9c140372b7f50ef48f42378cf85d9bc5","fixed":"c56b6f3d801d7ec8965993342bdd9e2972b6cb8e","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.11","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.11","status":"unaffected"},{"type":"semver","introduced":"6.11.3","lastAffected":"6.11.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.12","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.11","fixed":"6.11.3"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/59e081ff2e91bbf19b8c1ecb75b031f778858383","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c56b6f3d801d7ec8965993342bdd9e2972b6cb8e","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-10-22T13:34:43.848Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-49964","url":"https://www.cve.org/CVERecord?id=CVE-2024-49964","licence":"CVE Terms of Use","modified":"2026-05-11T20:42:57.013Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-49964","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-49964","licence":"Public domain","modified":"2026-06-17T08:00:50.413Z"}],"updatedAt":"2026-11-25T22:58:47.068Z","epss":{"score":0.00202,"percentile":0.10653,"date":"2026-12-01T12:00:22.000Z"}}