Skip to main content

CVE-2024-50229: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-50229cvecve-2024-50229
Published: Sat Nov 09 2024 (11/09/2024, 10:14:39 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: nilfs2: fix potential deadlock with newly created symlinks Syzbot reported that page_symlink(), called by nilfs_symlink(), triggers memory reclamation involving the filesystem layer, which can result in circular lock dependencies among the reader/writer semaphore nilfs->ns_segctor_sem, s_writers percpu_rwsem (intwrite) and the fs_reclaim pseudo lock. This is because after commit 21fc61c73c39 ("don't put symlink bodies in pagecache into highmem"), the gfp flags of the page cache for symbolic links are overwritten to GFP_KERNEL via inode_nohighmem(). This is not a problem for symlinks read from the backing device, because the __GFP_FS flag is dropped after inode_nohighmem() is called. However, when a new symlink is created with nilfs_symlink(), the gfp flags remain overwritten to GFP_KERNEL. Then, memory allocation called from page_symlink() etc. triggers memory reclamation including the FS layer, which may call nilfs_evict_inode() or nilfs_dirty_inode(). And these can cause a deadlock if they are called while nilfs->ns_segctor_sem is held: Fix this issue by dropping the __GFP_FS flag from the page cache GFP flags of newly created symlinks in the same way that nilfs_new_inode() and __nilfs_read_inode() do, as a workaround until we adopt nofs allocation scope consistently or improve the locking constraints.

AI-Powered Analysis

AILast updated: 06/27/2025, 21:57:43 UTC

Technical Analysis

CVE-2024-50229 is a vulnerability identified in the Linux kernel's NILFS2 (New Implementation of a Log-structured File System) implementation, specifically related to the handling of symbolic links (symlinks). The issue arises from a deadlock condition triggered by the interaction between memory reclamation processes and filesystem locking mechanisms. The root cause is linked to a recent kernel commit (21fc61c73c39) that changed how the GFP (Get Free Page) flags are set for page cache allocations of symlink bodies. After this commit, the GFP flags for newly created symlinks are set to GFP_KERNEL without dropping the __GFP_FS flag, unlike symlinks read from backing devices where __GFP_FS is dropped. This leads to memory allocation calls during symlink creation that can trigger memory reclamation involving the filesystem layer. During this reclamation, functions such as nilfs_evict_inode() or nilfs_dirty_inode() may be invoked while holding the nilfs->ns_segctor_sem semaphore, causing circular lock dependencies with other semaphores (s_writers percpu_rwsem and fs_reclaim pseudo lock). This circular dependency can result in a deadlock, effectively halting filesystem operations involving NILFS2 symlinks. The fix involves dropping the __GFP_FS flag from the GFP flags for newly created symlinks, aligning their behavior with other inode operations, thereby preventing the deadlock scenario. This vulnerability is specific to the NILFS2 filesystem within the Linux kernel and affects versions including and around the specified commit hashes. No known exploits are reported in the wild as of the publication date.

Potential Impact

For European organizations, the impact of CVE-2024-50229 primarily concerns systems running Linux with the NILFS2 filesystem enabled and actively used. NILFS2, while not as common as ext4 or XFS, is utilized in certain environments requiring log-structured filesystem features, such as high-throughput or continuous snapshotting scenarios. A deadlock in the filesystem can cause system hangs or degraded performance, leading to denial of service conditions on affected hosts. This can disrupt critical services, especially in infrastructure relying on Linux servers for file storage or application hosting. In sectors like telecommunications, research institutions, or enterprises using specialized Linux distributions or configurations, this could impact availability and operational continuity. Although no direct data corruption or confidentiality breach is indicated, the deadlock can indirectly affect integrity by halting filesystem operations and potentially causing service outages. The absence of known exploits reduces immediate risk, but unpatched systems remain vulnerable to accidental or malicious triggering of the deadlock, which could be leveraged in targeted denial of service attacks.

Mitigation Recommendations

European organizations should take the following specific mitigation steps: 1) Identify and inventory Linux systems using NILFS2 filesystems, focusing on servers and devices where NILFS2 is enabled or could be enabled. 2) Apply the latest Linux kernel patches that address CVE-2024-50229 as soon as they become available from trusted Linux distribution vendors or upstream kernel sources. 3) If immediate patching is not feasible, consider disabling NILFS2 usage or migrating data to alternative stable filesystems like ext4 or XFS to avoid exposure. 4) Monitor system logs and kernel messages for signs of deadlocks or filesystem hangs related to NILFS2 symlink operations. 5) Implement robust system monitoring and alerting to detect and respond quickly to filesystem performance degradation or deadlocks. 6) For development or testing environments, validate kernel updates in controlled settings to ensure stability before wide deployment. 7) Engage with Linux distribution security advisories and subscribe to relevant mailing lists to stay informed about updates and related vulnerabilities.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-10-21T19:36:19.973Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9820c4522896dcbdcf81

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

Last enriched: 6/27/2025, 9:57:43 PM

Last updated: 8/12/2025, 2:18:25 PM

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