vulnerability

Red Hat: CVE-2024-49872: kernel: mm/gup: fix memfd_pin_folios alloc race panic

Severity
4
CVSS
(AV:L/AC:M/Au:S/C:N/I:N/A:C)
Published
Oct 21, 2024
Added
Jul 9, 2025
Modified
Jul 10, 2025

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.

Solution

no-fix-redhat-rpm-package
Title
NEW

Explore Exposure Command

Confidently identify and prioritize exposures from endpoint to cloud with full attack surface visibility and threat-aware risk context.