CVE-2024-35844: f2fs: compress: fix reserve_cblocks counting error when out of space

Published May 17, 2024
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

f2fs: compress: fix reservecblocks counting error when out of space

When a file only needs one directnode, performing the following operations will cause the file to be unrepairable:

unisoc # ./f2fsio compress test.apk unisoc #df -h | grep dm-48 /dev/block/dm-48 112G 112G 1.2M 100% /data

unisoc # ./f2fsio releasecblocks 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 # ./f2fsio reservecblocks test.apk F2FSIOCRESERVECOMPRESSBLOCKS failed: No space left on device

adb reboot unisoc # df -h | grep dm-48 /dev/block/dm-48 112G 112G 11M 100% /data unisoc # ./f2fsio reservecblocks test.apk 0

This is because the file has only one directnode. After returning to -ENOSPC, reservedblocks += ret will not be executed. As a result, the reservedblocks 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 # ./f2fsio reservecblocks test.apk F2FSIOCRESERVECOMPRESSBLOCKS 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 # ./f2fsio reservecblocks test.apk 924

Affected Software

6 affected componentsFixes available
debian/linux<=5.10.223-1, <=5.10.234-1
6.1.129-16.1.135-16.12.25-16.12.27-1
Linux Linux kernel>=5.8<5.15.153
Linux Linux kernel>=5.16<6.1.83
Linux Linux kernel>=6.2<6.6.23
Linux Linux kernel>=6.7<6.7.11
Linux Linux kernel>=6.8<6.8.2

Event History

May 17, 2024
CVE Published
via MITRE·02:40 PM
Data Sourced
via MITRE·02:40 PM
Description
Data Sourced
via NVD·03:15 PM
Description
Data Sourced
via NVD·03:15 PM
RemedySeverityAffected Software
Jun 28, 2024
Data Sourced
via Launchpad·02:09 AM
Description
Apr 29, 2025
Data Sourced
via Ubuntu·06:21 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-35844?

CVE-2024-35844 is considered a moderate severity vulnerability affecting the Linux kernel's f2fs compression functionality.

2

How do I fix CVE-2024-35844?

To fix CVE-2024-35844, update to the patched versions of the Linux kernel: 6.1.123-1, 6.1.119-1, 6.12.11-1, or 6.12.12-1.

3

Which versions of the Linux kernel are affected by CVE-2024-35844?

CVE-2024-35844 affects Linux kernel versions up to and including 5.10.226-1.

4

What is the impact of CVE-2024-35844 on f2fs file system operations?

The impact of CVE-2024-35844 is that performing certain operations may cause files to become unrepairable when using the f2fs file system.

5

Are there any specific conditions to trigger CVE-2024-35844?

Yes, the vulnerability can be triggered when a file requires only one direct_node and specific compression operations are performed.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203