# CVE-2024-35844: f2fs: compress: fix reserve\_cblocks counting error when out of space

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.31% (percentile 16, 2026-11-26)
- **Published:** 2024-05-17T14:40:11.419Z
- **Modified:** 2026-06-17T07:35:32.270Z

## Who should check

- Anyone running Linux \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< fa3ac8b1a227d9b470b87972494293348b5839ee; \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< 889846dfc8ee2cf31148a44bfd2faeb2faadc685; \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< f0bf89e84c3afb79d7a3a9e4bc853ad6a3245c0a; \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< 569c198c9e2093fd29cc071856a4e548fda506bc; \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< fc0aed88afbf6f606205129a7466eebdf528e3f3; \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< 2f6d721e14b69d6e1251f69fa238b48e8374e25f
- Anyone running Linux 5.8

## 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 and fixed versions

- Linux: \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< fa3ac8b1a227d9b470b87972494293348b5839ee; \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< 889846dfc8ee2cf31148a44bfd2faeb2faadc685; \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< f0bf89e84c3afb79d7a3a9e4bc853ad6a3245c0a; \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< 569c198c9e2093fd29cc071856a4e548fda506bc; \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< fc0aed88afbf6f606205129a7466eebdf528e3f3; \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< 2f6d721e14b69d6e1251f69fa238b48e8374e25f (cvelist)
- Linux: 5.8 (cvelist)

## Mitigation

- Upgrade Linux to 2f6d721e14b69d6e1251f69fa238b48e8374e25f or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-35844. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-35844.md
Affected: Linux >= c75488fb4d82b697f381f855bf5b16779df440aa, < fa3ac8b1a227d9b470b87972494293348b5839ee; >= c75488fb4d82b697f381f855bf5b16779df440aa, < 889846dfc8ee2cf31148a44bfd2faeb2faadc685; >= c75488fb4d82b697f381f855bf5b16779df440aa, < f0bf89e84c3afb79d7a3a9e4bc853ad6a3245c0a; >= c75488fb4d82b697f381f85…
Fixed in: Linux 889846dfc8ee2cf31148a44bfd2faeb2faadc685, Linux 569c198c9e2093fd29cc071856a4e548fda506bc, Linux 2f6d721e14b69d6e1251f69fa238b48e8374e25f

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-35844 being exploited?

There is no confirmed exploitation: CVE-2024-35844 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.31% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-35844?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-35844?

Linux \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< fa3ac8b1a227d9b470b87972494293348b5839ee; \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< 889846dfc8ee2cf31148a44bfd2faeb2faadc685; \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< f0bf89e84c3afb79d7a3a9e4bc853ad6a3245c0a; \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< 569c198c9e2093fd29cc071856a4e548fda506bc; \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< fc0aed88afbf6f606205129a7466eebdf528e3f3; \>= c75488fb4d82b697f381f855bf5b16779df440aa, \< 2f6d721e14b69d6e1251f69fa238b48e8374e25f; Linux 5.8.

### Is there a fix for CVE-2024-35844?

Yes. Fixed in Linux 889846dfc8ee2cf31148a44bfd2faeb2faadc685, Linux 569c198c9e2093fd29cc071856a4e548fda506bc, Linux 2f6d721e14b69d6e1251f69fa238b48e8374e25f. Upgrade Linux to 2f6d721e14b69d6e1251f69fa238b48e8374e25f or later.

### How do I check if I'm affected by CVE-2024-35844?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/fa3ac8b1a227d9b470b87972494293348b5839ee>
- patch: <https://git.kernel.org/stable/c/889846dfc8ee2cf31148a44bfd2faeb2faadc685>
- patch: <https://git.kernel.org/stable/c/f0bf89e84c3afb79d7a3a9e4bc853ad6a3245c0a>
- patch: <https://git.kernel.org/stable/c/569c198c9e2093fd29cc071856a4e548fda506bc>
- patch: <https://git.kernel.org/stable/c/fc0aed88afbf6f606205129a7466eebdf528e3f3>
- patch: <https://git.kernel.org/stable/c/2f6d721e14b69d6e1251f69fa238b48e8374e25f>
- other: <http://www.openwall.com/lists/oss-security/2024/05/30/2>
- other: <http://www.openwall.com/lists/oss-security/2024/05/30/1>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-35844>

HTML: <https://flawdb.com/CVE-2024-35844> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-35844>
