CVE-2024-33847: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: f2fs: compress: don't allow unaligned truncation on released compress inode f2fs image may be corrupted after below testcase: - mkfs.f2fs -O extra_attr,compression -f /dev/vdb - mount /dev/vdb /mnt/f2fs - touch /mnt/f2fs/file - f2fs_io setflags compression /mnt/f2fs/file - dd if=/dev/zero of=/mnt/f2fs/file bs=4k count=4 - f2fs_io release_cblocks /mnt/f2fs/file - truncate -s 8192 /mnt/f2fs/file - umount /mnt/f2fs - fsck.f2fs /dev/vdb [ASSERT] (fsck_chk_inode_blk:1256) --> ino: 0x5 has i_blocks: 0x00000002, but has 0x3 blocks [FSCK] valid_block_count matching with CP [Fail] [0x4, 0x5] [FSCK] other corrupted bugs [Fail] The reason is: partial truncation assume compressed inode has reserved blocks, after partial truncation, valid block count may change w/o .i_blocks and .total_valid_block_count update, result in corruption. This patch only allow cluster size aligned truncation on released compress inode for fixing.
AI Analysis
Technical Summary
CVE-2024-33847 is a vulnerability identified in the Linux kernel's implementation of the f2fs (Flash-Friendly File System) compression feature. The issue arises when performing unaligned truncation operations on released compressed inodes. Specifically, the vulnerability is triggered by a sequence of operations involving creating an f2fs filesystem with compression enabled, mounting it, creating and compressing a file, writing data, releasing compressed blocks, truncating the file to a size not aligned with cluster boundaries, unmounting, and then running filesystem checks (fsck). The root cause is that partial truncation assumes compressed inodes have reserved blocks; however, after such truncation, the valid block count changes without corresponding updates to the inode's i_blocks and total_valid_block_count fields. This discrepancy leads to filesystem corruption, as evidenced by failed fsck checks and assertion failures indicating mismatches in block counts. The patch to fix this vulnerability enforces that truncation on released compressed inodes must be aligned to cluster sizes, preventing the inconsistent state that leads to corruption. This vulnerability affects specific Linux kernel versions identified by commit hashes and was published on June 24, 2024. 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 relying on Linux systems with f2fs filesystems and compression enabled, this vulnerability poses a risk of filesystem corruption leading to potential data loss or system instability. The corruption occurs during specific file operations involving compression and truncation, which could be triggered by legitimate system or application processes or potentially by malicious actors with local access. The impact primarily affects data integrity and availability, as corrupted filesystems may require repair or restoration from backups, causing downtime and operational disruption. Confidentiality impact is minimal as the vulnerability does not directly expose data but rather compromises filesystem consistency. Organizations using embedded devices, IoT, or storage systems that utilize f2fs with compression (common in flash storage environments) are particularly at risk. The absence of known exploits reduces immediate threat but the complexity of the issue means that inadvertent triggering by software or users is possible, especially in environments with automated file management or backup systems. Recovery from corruption may be time-consuming and could lead to loss of critical data if backups are not current.
Mitigation Recommendations
European organizations should prioritize updating their Linux kernels to versions that include the patch enforcing cluster size aligned truncation on released compressed inodes. System administrators should audit their environments to identify systems using f2fs with compression enabled, especially on devices with flash storage. Until patches are applied, avoid performing file truncation operations on compressed filesystems or restrict such operations to trusted users and processes. Implement monitoring to detect filesystem inconsistencies early, including regular fsck checks during maintenance windows. Backup strategies should be reviewed and tested to ensure rapid recovery from potential corruption. For embedded and IoT devices, coordinate with vendors to obtain firmware updates incorporating the fix. Additionally, consider disabling compression on f2fs filesystems if immediate patching is not feasible, balancing performance and storage efficiency against data integrity risks. Finally, educate system users and developers about the risks of unaligned truncation on compressed files to prevent inadvertent triggering.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Italy, Spain
CVE-2024-33847: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: f2fs: compress: don't allow unaligned truncation on released compress inode f2fs image may be corrupted after below testcase: - mkfs.f2fs -O extra_attr,compression -f /dev/vdb - mount /dev/vdb /mnt/f2fs - touch /mnt/f2fs/file - f2fs_io setflags compression /mnt/f2fs/file - dd if=/dev/zero of=/mnt/f2fs/file bs=4k count=4 - f2fs_io release_cblocks /mnt/f2fs/file - truncate -s 8192 /mnt/f2fs/file - umount /mnt/f2fs - fsck.f2fs /dev/vdb [ASSERT] (fsck_chk_inode_blk:1256) --> ino: 0x5 has i_blocks: 0x00000002, but has 0x3 blocks [FSCK] valid_block_count matching with CP [Fail] [0x4, 0x5] [FSCK] other corrupted bugs [Fail] The reason is: partial truncation assume compressed inode has reserved blocks, after partial truncation, valid block count may change w/o .i_blocks and .total_valid_block_count update, result in corruption. This patch only allow cluster size aligned truncation on released compress inode for fixing.
AI-Powered Analysis
Technical Analysis
CVE-2024-33847 is a vulnerability identified in the Linux kernel's implementation of the f2fs (Flash-Friendly File System) compression feature. The issue arises when performing unaligned truncation operations on released compressed inodes. Specifically, the vulnerability is triggered by a sequence of operations involving creating an f2fs filesystem with compression enabled, mounting it, creating and compressing a file, writing data, releasing compressed blocks, truncating the file to a size not aligned with cluster boundaries, unmounting, and then running filesystem checks (fsck). The root cause is that partial truncation assumes compressed inodes have reserved blocks; however, after such truncation, the valid block count changes without corresponding updates to the inode's i_blocks and total_valid_block_count fields. This discrepancy leads to filesystem corruption, as evidenced by failed fsck checks and assertion failures indicating mismatches in block counts. The patch to fix this vulnerability enforces that truncation on released compressed inodes must be aligned to cluster sizes, preventing the inconsistent state that leads to corruption. This vulnerability affects specific Linux kernel versions identified by commit hashes and was published on June 24, 2024. 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 relying on Linux systems with f2fs filesystems and compression enabled, this vulnerability poses a risk of filesystem corruption leading to potential data loss or system instability. The corruption occurs during specific file operations involving compression and truncation, which could be triggered by legitimate system or application processes or potentially by malicious actors with local access. The impact primarily affects data integrity and availability, as corrupted filesystems may require repair or restoration from backups, causing downtime and operational disruption. Confidentiality impact is minimal as the vulnerability does not directly expose data but rather compromises filesystem consistency. Organizations using embedded devices, IoT, or storage systems that utilize f2fs with compression (common in flash storage environments) are particularly at risk. The absence of known exploits reduces immediate threat but the complexity of the issue means that inadvertent triggering by software or users is possible, especially in environments with automated file management or backup systems. Recovery from corruption may be time-consuming and could lead to loss of critical data if backups are not current.
Mitigation Recommendations
European organizations should prioritize updating their Linux kernels to versions that include the patch enforcing cluster size aligned truncation on released compressed inodes. System administrators should audit their environments to identify systems using f2fs with compression enabled, especially on devices with flash storage. Until patches are applied, avoid performing file truncation operations on compressed filesystems or restrict such operations to trusted users and processes. Implement monitoring to detect filesystem inconsistencies early, including regular fsck checks during maintenance windows. Backup strategies should be reviewed and tested to ensure rapid recovery from potential corruption. For embedded and IoT devices, coordinate with vendors to obtain firmware updates incorporating the fix. Additionally, consider disabling compression on f2fs filesystems if immediate patching is not feasible, balancing performance and storage efficiency against data integrity risks. Finally, educate system users and developers about the risks of unaligned truncation on compressed files to prevent inadvertent triggering.
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-06-24T13:54:11.027Z
- Cisa Enriched
- true
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682d982ac4522896dcbe346d
Added to database: 5/21/2025, 9:08:58 AM
Last enriched: 6/29/2025, 3:41:50 PM
Last updated: 8/14/2025, 4:51:08 AM
Views: 14
Related Threats
CVE-2025-9091: Hard-coded Credentials in Tenda AC20
LowCVE-2025-9090: Command Injection in Tenda AC20
MediumCVE-2025-9092: CWE-400 Uncontrolled Resource Consumption in Legion of the Bouncy Castle Inc. Bouncy Castle for Java - BC-FJA 2.1.0
LowCVE-2025-9089: Stack-based Buffer Overflow in Tenda AC20
HighCVE-2025-9088: Stack-based Buffer Overflow in Tenda AC20
HighActions
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.