CVE-2024-35844

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-35844
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-35844.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-35844
Downstream
Published
2024-05-17T14:40:11.419Z
Modified
2025-11-26T19:33:32.689352Z
Summary
f2fs: compress: fix reserve_cblocks counting error when out of space
Details

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 # ./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 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 # ./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

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/blob/9c3874e559580d6c6ec8d449812ac11277724770/cves/2024/35xxx/CVE-2024-35844.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
c75488fb4d82b697f381f855bf5b16779df440aa
Fixed
fa3ac8b1a227d9b470b87972494293348b5839ee
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
c75488fb4d82b697f381f855bf5b16779df440aa
Fixed
889846dfc8ee2cf31148a44bfd2faeb2faadc685
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
c75488fb4d82b697f381f855bf5b16779df440aa
Fixed
f0bf89e84c3afb79d7a3a9e4bc853ad6a3245c0a
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
c75488fb4d82b697f381f855bf5b16779df440aa
Fixed
569c198c9e2093fd29cc071856a4e548fda506bc
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
c75488fb4d82b697f381f855bf5b16779df440aa
Fixed
fc0aed88afbf6f606205129a7466eebdf528e3f3
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
c75488fb4d82b697f381f855bf5b16779df440aa
Fixed
2f6d721e14b69d6e1251f69fa238b48e8374e25f

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.8.0
Fixed
5.15.153
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.83
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.23
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.7.11
Type
ECOSYSTEM
Events
Introduced
6.8.0
Fixed
6.8.2