Skip to main content

CVE-2024-57942: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-57942cvecve-2024-57942
Published: Tue Jan 21 2025 (01/21/2025, 12:18:10 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: netfs: Fix ceph copy to cache on write-begin At the end of netfs_unlock_read_folio() in which folios are marked appropriately for copying to the cache (either with by being marked dirty and having their private data set or by having PG_private_2 set) and then unlocked, the folio_queue struct has the entry pointing to the folio cleared. This presents a problem for netfs_pgpriv2_write_to_the_cache(), which is used to write folios marked with PG_private_2 to the cache as it expects to be able to trawl the folio_queue list thereafter to find the relevant folios, leading to a hang. Fix this by not clearing the folio_queue entry if we're going to do the deprecated copy-to-cache. The clearance will be done instead as the folios are written to the cache. This can be reproduced by starting cachefiles, mounting a ceph filesystem with "-o fsc" and writing to it.

AI-Powered Analysis

AILast updated: 06/28/2025, 09:12:01 UTC

Technical Analysis

CVE-2024-57942 is a vulnerability identified in the Linux kernel's netfs subsystem, specifically affecting the handling of folios during copy-to-cache operations in Ceph filesystems mounted with the "-o fsc" option. The issue arises in the function netfs_unlock_read_folio(), where folios are marked for copying to cache by setting them dirty and manipulating private data flags such as PG_private_2. After marking, the folio_queue struct entry pointing to the folio is cleared prematurely. This clearing disrupts the subsequent operation netfs_pgpriv2_write_to_the_cache(), which relies on traversing the folio_queue to locate folios marked with PG_private_2 for writing to the cache. Because the folio_queue entry is cleared too early, the traversal fails, causing the system to hang during the copy-to-cache process. The vulnerability can be reproduced by enabling cachefiles, mounting a Ceph filesystem with the "-o fsc" option, and performing write operations. The fix involves deferring the clearing of the folio_queue entry until after the folios are written to the cache, ensuring that the traversal logic in netfs_pgpriv2_write_to_the_cache() functions correctly. This vulnerability is rooted in the kernel's memory management and caching mechanisms for network filesystems, specifically impacting Ceph, a widely used distributed storage system in Linux environments.

Potential Impact

The vulnerability can cause system hangs during write operations on Ceph filesystems using the cachefiles feature, leading to denial of service (DoS) conditions. For European organizations relying on Ceph for distributed storage—common in cloud providers, research institutions, and enterprises managing large-scale data—this can disrupt critical storage availability and data processing workflows. The hang may affect servers running Linux kernels with the vulnerable code, potentially impacting data centers and cloud infrastructure that use Ceph with cachefiles enabled. While the vulnerability does not appear to allow privilege escalation or data corruption directly, the availability impact could be significant in environments where uptime and storage performance are critical. Additionally, the lack of known exploits in the wild suggests limited immediate threat, but the potential for DoS in production systems warrants prompt attention. Organizations using Ceph with the "-o fsc" mount option and cachefiles should be particularly cautious, as this configuration triggers the vulnerability.

Mitigation Recommendations

To mitigate this vulnerability, European organizations should: 1) Apply the official Linux kernel patches that address CVE-2024-57942 as soon as they become available from trusted sources or Linux distribution vendors. 2) Temporarily disable the use of cachefiles or avoid mounting Ceph filesystems with the "-o fsc" option until patches are applied, as this configuration triggers the issue. 3) Monitor system logs and Ceph filesystem behavior for signs of hangs or performance degradation during write operations. 4) Conduct thorough testing of kernel updates in staging environments to ensure compatibility and stability before deployment. 5) Implement robust monitoring and alerting for storage subsystem health to detect early signs of hangs or DoS conditions. 6) Engage with Ceph and Linux kernel communities for updates and best practices related to this vulnerability. These steps go beyond generic advice by focusing on configuration changes and proactive monitoring tailored to the specific conditions that trigger the vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-01-19T11:50:08.378Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9823c4522896dcbdeb23

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

Last enriched: 6/28/2025, 9:12:01 AM

Last updated: 7/30/2025, 12:54:25 AM

Views: 10

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