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

Medium 4.7 Published Updated

A race condition in the Linux kernel's memfd_pin_folios function can cause a system panic, leading to denial of service.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-49872?

CVE-2024-49872 is a medium-severity vulnerability in Linux kernel, published on 21 Oct 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official 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.

Weakness: CWE-362

Which versions are affected by CVE-2024-49872?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-49872?

Apply the vendor's patch.

Is CVE-2024-49872 being exploited?

There is no known exploitation of CVE-2024-49872 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-49872, DEBIAN-CVE-2024-49872, GHSA-rrh5-rfhq-mff2, UBUNTU-CVE-2024-49872.

Is CVE-2024-49872 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free