Skip to main content

CVE-2024-49872: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-49872cvecve-2024-49872
Published: Mon Oct 21 2024 (10/21/2024, 18:01:13 UTC)
Source: CVE
Vendor/Project: Linux
Product: 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.

AI-Powered Analysis

AILast updated: 06/28/2025, 20:57:28 UTC

Technical Analysis

CVE-2024-49872 is a recently disclosed vulnerability in the Linux kernel, specifically within the memory management subsystem related to the handling of huge pages in the memfd_pin_folios function. The vulnerability arises from a race condition during the allocation of huge page folios. When memfd_pin_folios attempts to allocate a huge page folio, it calls memfd_alloc_folio. If another process concurrently creates the same huge page folio, memfd_alloc_folio returns an error code -EEXIST. However, the current code does not properly handle this error condition, leading to a scenario where the folio pointer is not reset to NULL. On subsequent iterations of the allocation loop, this stale pointer causes the kernel to invoke folio_put on an invalid folio, resulting in a kernel panic. This panic effectively causes a denial of service (DoS) by crashing the affected system. The fix involves setting the folio pointer to NULL upon encountering the -EEXIST error, preventing the kernel panic. The vulnerability affects Linux kernel versions identified by the commit hash 89c1905d9c140372b7f50ef48f42378cf85d9bc5, and it was published on October 21, 2024. There are no known exploits in the wild at this time, and no CVSS score has been assigned yet. The issue is a memory management race condition that can be triggered by concurrent operations involving huge page allocations in memfd, which is used for memory file descriptors enabling efficient memory sharing and management in Linux.

Potential Impact

The primary impact of CVE-2024-49872 is a denial of service condition caused by a kernel panic. For European organizations relying on Linux-based infrastructure—ranging from servers, cloud environments, container hosts, to embedded devices—this vulnerability could lead to unexpected system crashes, resulting in service outages and potential disruption of critical business operations. Given the kernel-level nature of the flaw, exploitation does not require user-level privileges but does require triggering specific memory allocation patterns, which might be achievable by local users or processes. The vulnerability could affect high-availability systems, cloud service providers, and enterprises using Linux for critical workloads, potentially impacting data center operations and service continuity. Although no remote exploit is currently known, the risk of local privilege escalation or DoS in multi-tenant environments (e.g., shared hosting, cloud platforms) is a concern. European organizations with stringent uptime requirements, such as financial institutions, healthcare providers, and public sector entities, could face operational and reputational risks if affected systems crash unexpectedly. Additionally, recovery from kernel panics may require manual intervention or system reboots, increasing downtime and operational costs.

Mitigation Recommendations

To mitigate CVE-2024-49872, European organizations should prioritize applying the official Linux kernel patch that sets the folio pointer to NULL upon encountering the -EEXIST error in memfd_pin_folios. System administrators should: 1) Identify and inventory Linux systems running affected kernel versions, especially those using memfd and huge page features. 2) Test and deploy updated kernel versions or patches from trusted Linux distributors promptly. 3) Monitor kernel logs for signs of memory allocation errors or panics related to memfd operations. 4) Implement strict access controls to limit unprivileged users' ability to trigger memfd operations, reducing the attack surface. 5) In containerized or virtualized environments, isolate workloads to prevent local users from exploiting the race condition. 6) Employ kernel live patching solutions where available to minimize downtime during patch deployment. 7) Maintain robust backup and recovery procedures to quickly restore systems in case of crashes. 8) Engage with Linux vendor security advisories and subscribe to relevant threat intelligence feeds for updates on exploit developments. These steps go beyond generic advice by focusing on the specific kernel subsystem and operational contexts where the vulnerability manifests.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-10-21T12:17:06.020Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9825c4522896dcbe0844

Added to database: 5/21/2025, 9:08:53 AM

Last enriched: 6/28/2025, 8:57:28 PM

Last updated: 8/14/2025, 6:23:54 PM

Views: 15

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats