CVE-2024-26704: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: ext4: fix double-free of blocks due to wrong extents moved_len In ext4_move_extents(), moved_len is only updated when all moves are successfully executed, and only discards orig_inode and donor_inode preallocations when moved_len is not zero. When the loop fails to exit after successfully moving some extents, moved_len is not updated and remains at 0, so it does not discard the preallocations. If the moved extents overlap with the preallocated extents, the overlapped extents are freed twice in ext4_mb_release_inode_pa() and ext4_process_freed_data() (as described in commit 94d7c16cbbbd ("ext4: Fix double-free of blocks with EXT4_IOC_MOVE_EXT")), and bb_free is incremented twice. Hence when trim is executed, a zero-division bug is triggered in mb_update_avg_fragment_size() because bb_free is not zero and bb_fragments is zero. Therefore, update move_len after each extent move to avoid the issue.
AI Analysis
Technical Summary
CVE-2024-26704 is a vulnerability identified in the Linux kernel's ext4 filesystem implementation, specifically within the ext4_move_extents() function. The flaw arises from improper handling of the moved_len variable, which tracks the number of successfully moved extents during a block move operation. In the vulnerable code, moved_len is only updated after all extents are moved successfully. However, if the loop exits prematurely after moving some extents, moved_len remains zero. This causes the function to incorrectly retain preallocations for orig_inode and donor_inode. When the moved extents overlap with these preallocated extents, a double-free condition occurs in ext4_mb_release_inode_pa() and ext4_process_freed_data(), leading to bb_free being incremented twice for the same blocks. This inconsistency triggers a zero-division error in mb_update_avg_fragment_size() during a trim operation because bb_free is non-zero while bb_fragments is zero. The root cause is the failure to update moved_len incrementally after each extent move, which results in improper memory management and potential kernel instability. The vulnerability can cause kernel crashes or denial of service due to the zero-division error and memory corruption from double-free. The fix involves updating moved_len after each extent move to ensure correct resource accounting and prevent double-free scenarios. This vulnerability affects Linux kernel versions containing the specified commit hashes prior to the fix and is relevant to systems using the ext4 filesystem with move extents operations. 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 poses a risk primarily to systems running Linux with ext4 filesystems, which are widely used in servers, cloud infrastructure, and enterprise environments. Exploitation could lead to kernel crashes resulting in denial of service, potentially disrupting critical services and operations. In environments with high availability requirements, such as financial institutions, healthcare providers, and government agencies, unexpected downtime could have significant operational and reputational impacts. Although no remote code execution or privilege escalation is directly indicated, the instability caused by double-free and zero-division errors could be leveraged by attackers to cause persistent service outages or to facilitate further attacks by destabilizing systems. Organizations relying on Linux-based storage solutions or virtualized environments using ext4 should be particularly vigilant. The absence of known exploits suggests a window for proactive patching before active exploitation occurs, which is critical to maintaining system integrity and availability.
Mitigation Recommendations
European organizations should prioritize applying the official Linux kernel patches that address this vulnerability by correctly updating moved_len after each extent move. System administrators should: 1) Identify all Linux systems using ext4 filesystems, especially those performing frequent extent move operations (e.g., during filesystem maintenance or defragmentation). 2) Update Linux kernels to the latest stable versions containing the fix for CVE-2024-26704. 3) Test patches in staging environments to ensure compatibility and stability before deployment in production. 4) Monitor kernel logs and system behavior for signs of ext4-related errors or crashes that could indicate exploitation attempts. 5) Implement robust backup and recovery procedures to mitigate potential data loss from filesystem corruption. 6) Limit access to systems with ext4 filesystems to trusted administrators to reduce the risk of exploitation through local access. 7) Consider using filesystem integrity monitoring tools to detect anomalies in ext4 metadata and block allocation. These targeted actions go beyond generic advice by focusing on the specific ext4 move extents operation and the kernel versions affected.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Poland, Italy, Spain
CVE-2024-26704: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: ext4: fix double-free of blocks due to wrong extents moved_len In ext4_move_extents(), moved_len is only updated when all moves are successfully executed, and only discards orig_inode and donor_inode preallocations when moved_len is not zero. When the loop fails to exit after successfully moving some extents, moved_len is not updated and remains at 0, so it does not discard the preallocations. If the moved extents overlap with the preallocated extents, the overlapped extents are freed twice in ext4_mb_release_inode_pa() and ext4_process_freed_data() (as described in commit 94d7c16cbbbd ("ext4: Fix double-free of blocks with EXT4_IOC_MOVE_EXT")), and bb_free is incremented twice. Hence when trim is executed, a zero-division bug is triggered in mb_update_avg_fragment_size() because bb_free is not zero and bb_fragments is zero. Therefore, update move_len after each extent move to avoid the issue.
AI-Powered Analysis
Technical Analysis
CVE-2024-26704 is a vulnerability identified in the Linux kernel's ext4 filesystem implementation, specifically within the ext4_move_extents() function. The flaw arises from improper handling of the moved_len variable, which tracks the number of successfully moved extents during a block move operation. In the vulnerable code, moved_len is only updated after all extents are moved successfully. However, if the loop exits prematurely after moving some extents, moved_len remains zero. This causes the function to incorrectly retain preallocations for orig_inode and donor_inode. When the moved extents overlap with these preallocated extents, a double-free condition occurs in ext4_mb_release_inode_pa() and ext4_process_freed_data(), leading to bb_free being incremented twice for the same blocks. This inconsistency triggers a zero-division error in mb_update_avg_fragment_size() during a trim operation because bb_free is non-zero while bb_fragments is zero. The root cause is the failure to update moved_len incrementally after each extent move, which results in improper memory management and potential kernel instability. The vulnerability can cause kernel crashes or denial of service due to the zero-division error and memory corruption from double-free. The fix involves updating moved_len after each extent move to ensure correct resource accounting and prevent double-free scenarios. This vulnerability affects Linux kernel versions containing the specified commit hashes prior to the fix and is relevant to systems using the ext4 filesystem with move extents operations. 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 poses a risk primarily to systems running Linux with ext4 filesystems, which are widely used in servers, cloud infrastructure, and enterprise environments. Exploitation could lead to kernel crashes resulting in denial of service, potentially disrupting critical services and operations. In environments with high availability requirements, such as financial institutions, healthcare providers, and government agencies, unexpected downtime could have significant operational and reputational impacts. Although no remote code execution or privilege escalation is directly indicated, the instability caused by double-free and zero-division errors could be leveraged by attackers to cause persistent service outages or to facilitate further attacks by destabilizing systems. Organizations relying on Linux-based storage solutions or virtualized environments using ext4 should be particularly vigilant. The absence of known exploits suggests a window for proactive patching before active exploitation occurs, which is critical to maintaining system integrity and availability.
Mitigation Recommendations
European organizations should prioritize applying the official Linux kernel patches that address this vulnerability by correctly updating moved_len after each extent move. System administrators should: 1) Identify all Linux systems using ext4 filesystems, especially those performing frequent extent move operations (e.g., during filesystem maintenance or defragmentation). 2) Update Linux kernels to the latest stable versions containing the fix for CVE-2024-26704. 3) Test patches in staging environments to ensure compatibility and stability before deployment in production. 4) Monitor kernel logs and system behavior for signs of ext4-related errors or crashes that could indicate exploitation attempts. 5) Implement robust backup and recovery procedures to mitigate potential data loss from filesystem corruption. 6) Limit access to systems with ext4 filesystems to trusted administrators to reduce the risk of exploitation through local access. 7) Consider using filesystem integrity monitoring tools to detect anomalies in ext4 metadata and block allocation. These targeted actions go beyond generic advice by focusing on the specific ext4 move extents operation and the kernel versions affected.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- Linux
- Date Reserved
- 2024-02-19T14:20:24.158Z
- Cisa Enriched
- true
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682d982ac4522896dcbe3895
Added to database: 5/21/2025, 9:08:58 AM
Last enriched: 6/29/2025, 5:40:20 PM
Last updated: 7/27/2025, 7:32:38 AM
Views: 12
Related Threats
CVE-2025-8690: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in addix Simple Responsive Slider
MediumCVE-2025-8688: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in ebernstein Inline Stock Quotes
MediumCVE-2025-8685: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in emilien Wp chart generator
MediumCVE-2025-8621: CWE-80 Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) in odn Mosaic Generator
MediumCVE-2025-8568: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in prabode GMap Generator
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.