Skip to main content

CVE-2024-35844: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-35844cvecve-2024-35844
Published: Fri May 17 2024 (05/17/2024, 14:40:11 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: f2fs: compress: fix reserve_cblocks counting error when out of space When a file only needs one direct_node, performing the following operations will cause the file to be unrepairable: unisoc # ./f2fs_io compress test.apk unisoc #df -h | grep dm-48 /dev/block/dm-48 112G 112G 1.2M 100% /data unisoc # ./f2fs_io release_cblocks test.apk 924 unisoc # df -h | grep dm-48 /dev/block/dm-48 112G 112G 4.8M 100% /data unisoc # dd if=/dev/random of=file4 bs=1M count=3 3145728 bytes (3.0 M) copied, 0.025 s, 120 M/s unisoc # df -h | grep dm-48 /dev/block/dm-48 112G 112G 1.8M 100% /data unisoc # ./f2fs_io reserve_cblocks test.apk F2FS_IOC_RESERVE_COMPRESS_BLOCKS failed: No space left on device adb reboot unisoc # df -h | grep dm-48 /dev/block/dm-48 112G 112G 11M 100% /data unisoc # ./f2fs_io reserve_cblocks test.apk 0 This is because the file has only one direct_node. After returning to -ENOSPC, reserved_blocks += ret will not be executed. As a result, the reserved_blocks at this time is still 0, which is not the real number of reserved blocks. Therefore, fsck cannot be set to repair the file. After this patch, the fsck flag will be set to fix this problem. unisoc # df -h | grep dm-48 /dev/block/dm-48 112G 112G 1.8M 100% /data unisoc # ./f2fs_io reserve_cblocks test.apk F2FS_IOC_RESERVE_COMPRESS_BLOCKS failed: No space left on device adb reboot then fsck will be executed unisoc # df -h | grep dm-48 /dev/block/dm-48 112G 112G 11M 100% /data unisoc # ./f2fs_io reserve_cblocks test.apk 924

AI-Powered Analysis

AILast updated: 06/29/2025, 16:28:06 UTC

Technical Analysis

CVE-2024-35844 is a vulnerability identified in the Linux kernel's F2FS (Flash-Friendly File System) compression module. The issue arises from an incorrect accounting of reserved compressed blocks (reserve_cblocks) when the filesystem runs out of space. Specifically, when a file requires only one direct_node, certain operations involving reserving and releasing compressed blocks can cause the file to become unrepairable. The root cause is that after a failed attempt to reserve compressed blocks due to no space left (-ENOSPC), the internal counter for reserved blocks is not updated correctly, remaining at zero instead of reflecting the actual reserved blocks. This discrepancy prevents the filesystem check utility (fsck) from properly repairing the file system state. The vulnerability manifests when the device's storage is fully utilized, and operations such as compressing files or reserving compressed blocks fail but leave the filesystem in an inconsistent state. The patch fixes this by setting a flag that enables fsck to detect and repair the issue upon reboot. The vulnerability was demonstrated on a device using the dm-48 block device with a 112GB partition fully utilized, where repeated reserve and release operations on compressed blocks led to an unrepairable state until the patch was applied and fsck was triggered on reboot. No known exploits are reported in the wild, and the vulnerability affects specific Linux kernel versions identified by commit hashes. The issue is technical and specific to the F2FS compression reserve block accounting logic, impacting filesystem integrity and recoverability under out-of-space conditions.

Potential Impact

For European organizations relying on Linux systems with F2FS, particularly those using flash storage devices formatted with F2FS and employing compression features, this vulnerability could lead to filesystem corruption or unrepairable files when storage is fully utilized. This may result in data loss or downtime if critical files become inaccessible or the filesystem enters an inconsistent state. Systems that handle large amounts of compressed data or embedded devices using F2FS could be particularly vulnerable. The inability of fsck to repair the filesystem without the patch increases recovery complexity and risk of prolonged outages. While no remote code execution or privilege escalation is indicated, the impact on availability and integrity of data is significant in storage-constrained environments. European enterprises with embedded Linux devices, IoT infrastructure, or specialized storage setups using F2FS compression should be aware of potential operational disruptions. The vulnerability does not appear to require user interaction or authentication, but exploitation depends on the device reaching a full storage state and performing specific file operations, which may limit widespread impact but still poses a risk to critical systems.

Mitigation Recommendations

1. Apply the official Linux kernel patch that addresses CVE-2024-35844 as soon as it becomes available in your distribution or kernel vendor updates. 2. Monitor storage utilization closely on systems using F2FS with compression to avoid reaching full capacity, which triggers the vulnerability. Implement proactive storage management and alerts to prevent out-of-space conditions. 3. For embedded or specialized devices, consider disabling F2FS compression if patching is not immediately feasible, to avoid triggering the faulty reserve_cblocks logic. 4. After patching, ensure that fsck is run on reboot to repair any filesystem inconsistencies caused by the vulnerability. 5. Incorporate filesystem integrity checks into routine maintenance to detect early signs of corruption. 6. Review and test backup and recovery procedures for systems using F2FS to minimize data loss risk. 7. Engage with Linux kernel maintainers or vendors for backported patches if using long-term support kernels or custom builds. 8. Educate system administrators about the specific conditions that trigger this vulnerability to enhance operational awareness and incident response readiness.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-05-17T13:50:33.104Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982ac4522896dcbe362d

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

Last enriched: 6/29/2025, 4:28:06 PM

Last updated: 8/11/2025, 7:47:28 PM

Views: 18

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