Skip to main content

CVE-2024-40900: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-40900cvecve-2024-40900
Published: Fri Jul 12 2024 (07/12/2024, 12:20:42 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: cachefiles: remove requests from xarray during flushing requests Even with CACHEFILES_DEAD set, we can still read the requests, so in the following concurrency the request may be used after it has been freed: mount | daemon_thread1 | daemon_thread2 ------------------------------------------------------------ cachefiles_ondemand_init_object cachefiles_ondemand_send_req REQ_A = kzalloc(sizeof(*req) + data_len) wait_for_completion(&REQ_A->done) cachefiles_daemon_read cachefiles_ondemand_daemon_read // close dev fd cachefiles_flush_reqs complete(&REQ_A->done) kfree(REQ_A) xa_lock(&cache->reqs); cachefiles_ondemand_select_req req->msg.opcode != CACHEFILES_OP_READ // req use-after-free !!! xa_unlock(&cache->reqs); xa_destroy(&cache->reqs) Hence remove requests from cache->reqs when flushing them to avoid accessing freed requests.

AI-Powered Analysis

AILast updated: 06/29/2025, 12:56:48 UTC

Technical Analysis

CVE-2024-40900 is a use-after-free vulnerability identified in the Linux kernel's cachefiles subsystem. Cachefiles is a kernel module that allows caching of files on local storage to improve performance, often used in conjunction with network file systems like NFS. The vulnerability arises due to improper handling of request objects stored in an xarray data structure during the flushing of requests. Specifically, even when the CACHEFILES_DEAD flag is set, requests are not removed from the xarray before being freed. This leads to a race condition where concurrent threads may access a request after it has been freed, resulting in a use-after-free scenario. The technical sequence involves allocation of a request object (REQ_A), waiting for its completion, and during concurrent daemon threads' operations, the request is freed but still accessed in cachefiles_ondemand_select_req, causing potential memory corruption or kernel crashes. The root cause is the failure to remove requests from the cache->reqs xarray during flushing, which the patch addresses by ensuring proper removal to prevent access to freed memory. This vulnerability affects specific Linux kernel versions identified by the commit hash c8383054506c77b814489c09877b5db83fd4abf2 and was published on July 12, 2024. No known exploits are reported in the wild yet, and no CVSS score has been assigned.

Potential Impact

For European organizations, this vulnerability poses a significant risk primarily to systems running vulnerable Linux kernel versions with the cachefiles module enabled. Exploitation of this use-after-free flaw can lead to kernel memory corruption, potentially causing system crashes (denial of service) or enabling privilege escalation if an attacker can manipulate kernel memory. Given that Linux is widely deployed across European enterprises, cloud providers, and critical infrastructure, the impact could be substantial. Systems relying on cachefiles for caching network file system data, such as NFS clients in enterprise environments, are particularly at risk. Successful exploitation could disrupt business operations, compromise system integrity, and potentially allow attackers to gain elevated privileges, threatening confidentiality and availability. Although no active exploits are known, the vulnerability's nature and kernel-level impact warrant urgent attention, especially in sectors like finance, telecommunications, and government where Linux servers are prevalent.

Mitigation Recommendations

European organizations should prioritize updating their Linux kernels to versions where this vulnerability is patched, ensuring the cachefiles subsystem includes the fix that removes requests from the xarray before freeing them. Specifically, kernel maintainers and system administrators should apply the patch corresponding to commit c8383054506c77b814489c09877b5db83fd4abf2 or later stable releases containing this fix. In environments where immediate patching is not feasible, disabling the cachefiles module can mitigate risk by preventing the vulnerable code path from executing. Additionally, organizations should audit their Linux systems to identify usage of cachefiles and monitor kernel logs for anomalies or crashes that could indicate exploitation attempts. Employing kernel hardening techniques such as Kernel Address Space Layout Randomization (KASLR) and Kernel Page Table Isolation (KPTI) can reduce exploitation likelihood. Finally, integrating this vulnerability into vulnerability management and incident response workflows will ensure timely detection and remediation.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-07-12T12:17:45.579Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9829c4522896dcbe2dd6

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

Last enriched: 6/29/2025, 12:56:48 PM

Last updated: 7/29/2025, 3:34:34 PM

Views: 13

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