Skip to main content

CVE-2025-21721: Vulnerability in Linux Linux

High
VulnerabilityCVE-2025-21721cvecve-2025-21721
Published: Thu Feb 27 2025 (02/27/2025, 02:07:29 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: nilfs2: handle errors that nilfs_prepare_chunk() may return Patch series "nilfs2: fix issues with rename operations". This series fixes BUG_ON check failures reported by syzbot around rename operations, and a minor behavioral issue where the mtime of a child directory changes when it is renamed instead of moved. This patch (of 2): The directory manipulation routines nilfs_set_link() and nilfs_delete_entry() rewrite the directory entry in the folio/page previously read by nilfs_find_entry(), so error handling is omitted on the assumption that nilfs_prepare_chunk(), which prepares the buffer for rewriting, will always succeed for these. And if an error is returned, it triggers the legacy BUG_ON() checks in each routine. This assumption is wrong, as proven by syzbot: the buffer layer called by nilfs_prepare_chunk() may call nilfs_get_block() if necessary, which may fail due to metadata corruption or other reasons. This has been there all along, but improved sanity checks and error handling may have made it more reproducible in fuzzing tests. Fix this issue by adding missing error paths in nilfs_set_link(), nilfs_delete_entry(), and their caller nilfs_rename().

AI-Powered Analysis

AILast updated: 06/30/2025, 08:27:40 UTC

Technical Analysis

CVE-2025-21721 is a vulnerability identified in the Linux kernel's NILFS2 (New Implementation of a Log-structured File System) component, specifically related to error handling in directory manipulation routines. The vulnerability arises from the assumption that the function nilfs_prepare_chunk(), which prepares a buffer for rewriting directory entries, will always succeed. However, this assumption is incorrect because nilfs_prepare_chunk() may invoke nilfs_get_block(), which can fail due to reasons such as metadata corruption. The affected routines nilfs_set_link() and nilfs_delete_entry() rewrite directory entries without handling potential errors from nilfs_prepare_chunk(), leading to BUG_ON() kernel checks that cause kernel crashes or instability. Additionally, the vulnerability includes a behavioral issue where the modification time (mtime) of a child directory changes incorrectly during rename operations instead of move operations. The patch series addressing this vulnerability adds missing error handling paths in nilfs_set_link(), nilfs_delete_entry(), and their caller nilfs_rename(), preventing kernel panics and improving stability. This issue was discovered through fuzzing tests by syzbot, which highlighted the reproducibility of the error due to improved sanity checks. No known exploits are reported in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to systems running Linux kernels with the NILFS2 filesystem enabled or in use. While NILFS2 is not the most commonly deployed filesystem compared to ext4 or XFS, it is used in certain specialized environments requiring log-structured file systems, such as embedded systems, storage appliances, or research environments. Exploitation could lead to kernel crashes (denial of service) or system instability, impacting availability of critical services. In environments where NILFS2 is used for important data storage, this could result in operational disruptions and potential data integrity concerns due to improper handling of directory metadata. Since the vulnerability is triggered by rename operations, applications or services performing frequent file system renames on NILFS2 volumes are more susceptible. The lack of known exploits reduces immediate risk, but the presence of a kernel BUG_ON() triggered by this flaw means that attackers with local access or the ability to induce rename operations could cause denial of service. European organizations relying on Linux-based infrastructure, especially in sectors like telecommunications, research institutions, or industrial control systems where NILFS2 might be deployed, should be vigilant.

Mitigation Recommendations

1. Immediate patching: Apply the official Linux kernel patches that fix the error handling in nilfs_set_link(), nilfs_delete_entry(), and nilfs_rename() as soon as they are available and tested. 2. Audit filesystem usage: Identify systems using NILFS2 and assess whether they are exposed to rename operations that could trigger the vulnerability. 3. Limit exposure: Restrict access to systems with NILFS2 filesystems to trusted users and services to reduce the risk of malicious or accidental triggering of the flaw. 4. Monitoring and logging: Implement enhanced monitoring of kernel logs and system stability metrics to detect early signs of crashes or filesystem errors related to NILFS2 operations. 5. Backup and recovery: Ensure robust backup procedures are in place for systems using NILFS2 to mitigate potential data loss or corruption risks. 6. Consider filesystem alternatives: Where feasible, migrate critical workloads from NILFS2 to more widely supported and tested filesystems like ext4 or XFS until the vulnerability is fully mitigated. 7. Limit kernel fuzzing exposure: If fuzzing or automated testing tools are used in production environments, isolate them to prevent unintended triggering of this vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-12-29T08:45:45.753Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9832c4522896dcbe85c8

Added to database: 5/21/2025, 9:09:06 AM

Last enriched: 6/30/2025, 8:27:40 AM

Last updated: 8/4/2025, 12:20:28 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