# CVE-2024-49872: mm/gup: fix memfd_pin_folios alloc race panic

- Severity: Medium 4.7 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.18%, higher than 4% of CVEs (2026-11-30)
- Published: 2024-10-21T18:01:13.369Z
- Modified: 2026-06-17T08:00:37.747Z
- Weaknesses: CWE-362
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

mm/gup: fix memfd_pin_folios alloc race panic

If memfd_pin_folios tries to create a hugetlb page, but someone else
already did, then folio gets the value -EEXIST here:

        folio = memfd_alloc_folio(memfd, start_idx);
        if (IS_ERR(folio)) {
                ret = PTR_ERR(folio);
                if (ret != -EEXIST)
                        goto err;

then on the next trip through the "while start_idx" loop we panic here:

        if (folio) {
                folio_put(folio);

To fix, set the folio to NULL on error.

(As written by CVE List.)

## Affected

- Linux Linux: from 89c1905d9c140372b7f50ef48f42378cf85d9bc5 before e28f39b359c0cfdcc011603e51187085a5f1e5e3; from 89c1905d9c140372b7f50ef48f42378cf85d9bc5 before ce645b9fdc78ec5d28067286e92871ddae6817d5; 6.11 (not affected: before 6.11; from 6.11.3 up to 6.11.*; from 6.12 up to *)
- linux linux_kernel: from 6.11 before 6.11.3

## References

- <https://git.kernel.org/stable/c/e28f39b359c0cfdcc011603e51187085a5f1e5e3> (patch)
- <https://git.kernel.org/stable/c/ce645b9fdc78ec5d28067286e92871ddae6817d5> (patch)

## Sources

- CVE List: [CVE-2024-49872](https://www.cve.org/CVERecord?id=CVE-2024-49872), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2024-49872](https://nvd.nist.gov/vuln/detail/CVE-2024-49872), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-49872 · Whole record: https://cve.day/CVE-2024-49872.json · Rebuilt by cve.day 2026-11-25T22:58:47.018Z
