Vulnerability · Published May 17, 2024 · Assigned by Linux

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

Medium 5.5

In plain English

A medium-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 16% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS NVD)5.5Medium
Exploit odds (30 days)0.2%top 84.4% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux6.1.85-1DEBIAN-CVE-2024-35844
Debian:13linux6.7.12-1DEBIAN-CVE-2024-35844
Debian:14linux6.7.12-1DEBIAN-CVE-2024-35844
Ubuntu:22.04:LTSlinux5.15.0-112.122UBUNTU-CVE-2024-35844
Ubuntu:24.04:LTSlinux6.8.0-35.35UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-aws5.15.0-1063.69UBUNTU-CVE-2024-35844
Ubuntu:24.04:LTSlinux-aws6.8.0-1009.9UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-azure5.15.0-1066.75UBUNTU-CVE-2024-35844
Ubuntu:24.04:LTSlinux-azure6.8.0-1008.8UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-azure-fde5.15.0-1067.76.1UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-gcp5.15.0-1062.70UBUNTU-CVE-2024-35844
Ubuntu:24.04:LTSlinux-gcp6.8.0-1008.9UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-gke5.15.0-1060.66UBUNTU-CVE-2024-35844
Ubuntu:24.04:LTSlinux-gke6.8.0-1004.7UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1046.53UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-ibm5.15.0-1056.59UBUNTU-CVE-2024-35844
Ubuntu:24.04:LTSlinux-ibm6.8.0-1006.6UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1058.64UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-kvm5.15.0-1060.65UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-110.120UBUNTU-CVE-2024-35844
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-35.35.1UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1058.59UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-nvidia-tegra5.15.0-1026.26UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-nvidia-tegra-igx5.15.0-1015.15UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2024-35844
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1006.6UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-oracle5.15.0-1061.67UBUNTU-CVE-2024-35844
Ubuntu:24.04:LTSlinux-oracle6.8.0-1006.6UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-raspi5.15.0-1058.61UBUNTU-CVE-2024-35844
Ubuntu:24.04:LTSlinux-raspi6.8.0-1005.5UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-35844
Ubuntu:24.04:LTSlinux-riscv6.8.0-35.35.1UBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2024-35844
Ubuntu:22.04:LTSlinux-xilinx-zynqmp5.15.0-1030.34UBUNTU-CVE-2024-35844

Affected products (as reported)

VendorProductVersions
Linux Linux c75488fb4d82b697f381f855bf5b16779df440aa – before fa3ac8b1a227d9b470b87972494293348b5839eec75488fb4d82b697f381f855bf5b16779df440aa – before 889846dfc8ee2cf31148a44bfd2faeb2faadc685c75488fb4d82b697f381f855bf5b16779df440aa – before f0bf89e84c3afb79d7a3a9e4bc853ad6a3245c0ac75488fb4d82b697f381f855bf5b16779df440aa – before 569c198c9e2093fd29cc071856a4e548fda506bcc75488fb4d82b697f381f855bf5b16779df440aa – before fc0aed88afbf6f606205129a7466eebdf528e3f3c75488fb4d82b697f381f855bf5b16779df440aa – before 2f6d721e14b69d6e1251f69fa238b48e8374e25f
Linux Linux 5.8

References