Bug 2320440 (CVE-2024-49872) - CVE-2024-49872 kernel: mm/gup: fix memfd_pin_folios alloc race panic
Summary: CVE-2024-49872 kernel: mm/gup: fix memfd_pin_folios alloc race panic
Keywords:
Status: NEW
Alias: CVE-2024-49872
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On: 2320748
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-10-21 19:02 UTC by OSIDB Bzimport
Modified: 2024-10-21 22:27 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2024-10-21 19:02:07 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.