{"id":"CVE-2024-49872","summary":"mm/gup: fix memfd_pin_folios alloc race panic","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/gup: fix memfd_pin_folios alloc race panic\n\nIf memfd_pin_folios tries to create a hugetlb page, but someone else\nalready did, then folio gets the value -EEXIST here:\n\n        folio = memfd_alloc_folio(memfd, start_idx);\n        if (IS_ERR(folio)) {\n                ret = PTR_ERR(folio);\n                if (ret != -EEXIST)\n                        goto err;\n\nthen on the next trip through the \"while start_idx\" loop we panic here:\n\n        if (folio) {\n                folio_put(folio);\n\nTo fix, set the folio to NULL on error.","modified":"2026-04-02T12:21:04.238336Z","published":"2024-10-21T18:01:13.369Z","related":["USN-7276-1","USN-7277-1","openSUSE-SU-2024:14500-1","openSUSE-SU-2025:14705-1"],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/49xxx/CVE-2024-49872.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/ce645b9fdc78ec5d28067286e92871ddae6817d5"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e28f39b359c0cfdcc011603e51187085a5f1e5e3"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/49xxx/CVE-2024-49872.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-49872"},{"type":"PACKAGE","url":"https://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":"e28f39b359c0cfdcc011603e51187085a5f1e5e3"},{"fixed":"ce645b9fdc78ec5d28067286e92871ddae6817d5"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-49872.json"}}],"schema_version":"1.7.5"}