Skip to main content

CVE-2024-49870: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-49870cvecve-2024-49870
Published: Mon Oct 21 2024 (10/21/2024, 18:01:12 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: cachefiles: fix dentry leak in cachefiles_open_file() A dentry leak may be caused when a lookup cookie and a cull are concurrent: P1 | P2 ----------------------------------------------------------- cachefiles_lookup_cookie cachefiles_look_up_object lookup_one_positive_unlocked // get dentry cachefiles_cull inode->i_flags |= S_KERNEL_FILE; cachefiles_open_file cachefiles_mark_inode_in_use __cachefiles_mark_inode_in_use can_use = false if (!(inode->i_flags & S_KERNEL_FILE)) can_use = true return false return false // Returns an error but doesn't put dentry After that the following WARNING will be triggered when the backend folder is umounted: ================================================================== BUG: Dentry 000000008ad87947{i=7a,n=Dx_1_1.img} still in use (1) [unmount of ext4 sda] WARNING: CPU: 4 PID: 359261 at fs/dcache.c:1767 umount_check+0x5d/0x70 CPU: 4 PID: 359261 Comm: umount Not tainted 6.6.0-dirty #25 RIP: 0010:umount_check+0x5d/0x70 Call Trace: <TASK> d_walk+0xda/0x2b0 do_one_tree+0x20/0x40 shrink_dcache_for_umount+0x2c/0x90 generic_shutdown_super+0x20/0x160 kill_block_super+0x1a/0x40 ext4_kill_sb+0x22/0x40 deactivate_locked_super+0x35/0x80 cleanup_mnt+0x104/0x160 ================================================================== Whether cachefiles_open_file() returns true or false, the reference count obtained by lookup_positive_unlocked() in cachefiles_look_up_object() should be released. Therefore release that reference count in cachefiles_look_up_object() to fix the above issue and simplify the code.

AI-Powered Analysis

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

Technical Analysis

CVE-2024-49870 is a vulnerability identified in the Linux kernel's cachefiles subsystem, specifically related to a dentry (directory entry) leak occurring in the cachefiles_open_file() function. The issue arises due to improper reference count management when concurrent operations—namely lookup cookie and cull—occur. The vulnerability manifests when cachefiles_lookup_cookie and cachefiles_cull run concurrently, leading to a scenario where the reference count obtained by lookup_positive_unlocked() in cachefiles_look_up_object() is not properly released. This results in a dentry leak, which is a resource leak of directory entries that remain in use even after they should have been freed. The leak triggers kernel warnings during backend folder unmount operations, such as BUG messages indicating that a dentry is still in use during ext4 filesystem unmounts. The root cause is that cachefiles_open_file() returns an error without releasing the dentry reference, causing the reference count to remain elevated and preventing proper cleanup. The fix involves ensuring that the reference count is always released in cachefiles_look_up_object(), regardless of the return value of cachefiles_open_file(), thereby preventing the leak and simplifying the code. This vulnerability affects Linux kernel versions identified by the commit hash 1f08c925e7a38002bde509e66f6f891468848511 and likely other versions in the 6.x kernel series. There are no known exploits in the wild at the time of publication, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, this vulnerability could lead to system instability and potential denial of service conditions on Linux systems using the cachefiles feature, which is often employed to cache remote filesystems or accelerate network file access. The dentry leak can cause resource exhaustion over time, leading to kernel warnings and potentially impacting availability of critical services running on affected Linux servers. Organizations relying on Linux-based infrastructure for file sharing, cloud services, or network-attached storage could experience degraded performance or unexpected crashes during unmount operations or heavy cachefiles usage. While this vulnerability does not directly expose confidentiality or integrity risks, the resulting instability can disrupt business operations, especially in environments with high filesystem activity. Given the widespread use of Linux in European data centers, cloud providers, and enterprise environments, the impact could be significant if left unpatched. However, the absence of known exploits and the requirement for specific kernel configurations (cachefiles enabled) somewhat limit the immediate risk.

Mitigation Recommendations

European organizations should promptly apply the official Linux kernel patches that address this dentry leak in the cachefiles subsystem. Specifically, updating to a kernel version that includes the fix for CVE-2024-49870 is critical. System administrators should audit their Linux systems to determine if the cachefiles feature is enabled and actively used. If cachefiles is not required, disabling it can reduce the attack surface and prevent this issue from manifesting. Monitoring kernel logs for dentry leak warnings or BUG messages related to unmount operations can help detect if systems are affected. Additionally, organizations should implement proactive resource monitoring to identify abnormal increases in dentry usage or memory leaks. For environments where kernel upgrades are challenging, consider isolating affected systems or limiting unmount operations until patches can be applied. Coordination with Linux distribution vendors for timely patch deployment is recommended to ensure consistent remediation across infrastructure.

Need more detailed analysis?Get Pro

Technical Details

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

Threat ID: 682d9825c4522896dcbe0820

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

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

Last updated: 8/1/2025, 6:55:40 AM

Views: 14

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