# CVE-2022-49360: f2fs: fix to do sanity check on total\_data\_blocks

> 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.28% (percentile 13, 2026-11-26)
- **Published:** 2025-02-26T02:11:08.402Z
- **Modified:** 2026-08-15T13:17:20.483Z

## Who should check

- Anyone running Linux \>= 351df4b201157351c7d26bf12c3eeb9dbce98854, \< ef221b738b26d8c9f7e7967f4586db2dd3bd5288; \>= 351df4b201157351c7d26bf12c3eeb9dbce98854, \< c9e4cd5b0ccd7168801d6a811919171b185c5cf8; \>= 351df4b201157351c7d26bf12c3eeb9dbce98854, \< 071b1269a3b3ad9cec16ed76a48015bfffd9aee8; \>= 351df4b201157351c7d26bf12c3eeb9dbce98854, \< cc8c9df19971e59ebbe669ce710080e347dfec32; \>= 351df4b201157351c7d26bf12c3eeb9dbce98854, \< 6b8beca0edd32075a769bfe4178ca00c0dcd22a9
- Anyone running Linux 3.8

## Description

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

f2fs: fix to do sanity check on total\_data\_blocks

As Yanming reported in bugzilla:

https://bugzilla.kernel.org/show\_bug.cgi?id=215916

The kernel message is shown below:

kernel BUG at fs/f2fs/segment.c:2560!
Call Trace:
 allocate\_segment\_by\_default+0x228/0x440
 f2fs\_allocate\_data\_block+0x13d1/0x31f0
 do\_write\_page+0x18d/0x710
 f2fs\_outplace\_write\_data+0x151/0x250
 f2fs\_do\_write\_data\_page+0xef9/0x1980
 move\_data\_page+0x6af/0xbc0
 do\_garbage\_collect+0x312f/0x46f0
 f2fs\_gc+0x6b0/0x3bc0
 f2fs\_balance\_fs+0x921/0x2260
 f2fs\_write\_single\_data\_page+0x16be/0x2370
 f2fs\_write\_cache\_pages+0x428/0xd00
 f2fs\_write\_data\_pages+0x96e/0xd50
 do\_writepages+0x168/0x550
 \_\_writeback\_single\_inode+0x9f/0x870
 writeback\_sb\_inodes+0x47d/0xb20
 \_\_writeback\_inodes\_wb+0xb2/0x200
 wb\_writeback+0x4bd/0x660
 wb\_workfn+0x5f3/0xab0
 process\_one\_work+0x79f/0x13e0
 worker\_thread+0x89/0xf60
 kthread+0x26a/0x300
 ret\_from\_fork+0x22/0x30
RIP: 0010:new\_curseg+0xe8d/0x15f0

The root cause is: ckpt.valid\_block\_count is inconsistent with SIT table,
stat info indicates filesystem has free blocks, but SIT table indicates
filesystem has no free segment.

So that during garbage colloection, it triggers panic when LFS allocator
fails to find free segment.

This patch tries to fix this issue by checking consistency in between
ckpt.valid\_block\_count and block accounted from SIT.

## Affected and fixed versions

- Linux: \>= 351df4b201157351c7d26bf12c3eeb9dbce98854, \< ef221b738b26d8c9f7e7967f4586db2dd3bd5288; \>= 351df4b201157351c7d26bf12c3eeb9dbce98854, \< c9e4cd5b0ccd7168801d6a811919171b185c5cf8; \>= 351df4b201157351c7d26bf12c3eeb9dbce98854, \< 071b1269a3b3ad9cec16ed76a48015bfffd9aee8; \>= 351df4b201157351c7d26bf12c3eeb9dbce98854, \< cc8c9df19971e59ebbe669ce710080e347dfec32; \>= 351df4b201157351c7d26bf12c3eeb9dbce98854, \< 6b8beca0edd32075a769bfe4178ca00c0dcd22a9 (cvelist)
- Linux: 3.8 (cvelist)

## Mitigation

- Upgrade Linux to 6b8beca0edd32075a769bfe4178ca00c0dcd22a9 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2022-49360.md
Affected: Linux >= 351df4b201157351c7d26bf12c3eeb9dbce98854, < ef221b738b26d8c9f7e7967f4586db2dd3bd5288; >= 351df4b201157351c7d26bf12c3eeb9dbce98854, < c9e4cd5b0ccd7168801d6a811919171b185c5cf8; >= 351df4b201157351c7d26bf12c3eeb9dbce98854, < 071b1269a3b3ad9cec16ed76a48015bfffd9aee8; >= 351df4b201157351c7d26bf…
Fixed in: Linux 071b1269a3b3ad9cec16ed76a48015bfffd9aee8, Linux 6b8beca0edd32075a769bfe4178ca00c0dcd22a9

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-2022-49360 being exploited?

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

### How serious is CVE-2022-49360?

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

### Which versions are affected by CVE-2022-49360?

Linux \>= 351df4b201157351c7d26bf12c3eeb9dbce98854, \< ef221b738b26d8c9f7e7967f4586db2dd3bd5288; \>= 351df4b201157351c7d26bf12c3eeb9dbce98854, \< c9e4cd5b0ccd7168801d6a811919171b185c5cf8; \>= 351df4b201157351c7d26bf12c3eeb9dbce98854, \< 071b1269a3b3ad9cec16ed76a48015bfffd9aee8; \>= 351df4b201157351c7d26bf12c3eeb9dbce98854, \< cc8c9df19971e59ebbe669ce710080e347dfec32; \>= 351df4b201157351c7d26bf12c3eeb9dbce98854, \< 6b8beca0edd32075a769bfe4178ca00c0dcd22a9; Linux 3.8.

### Is there a fix for CVE-2022-49360?

Yes. Fixed in Linux 071b1269a3b3ad9cec16ed76a48015bfffd9aee8, Linux 6b8beca0edd32075a769bfe4178ca00c0dcd22a9. Upgrade Linux to 6b8beca0edd32075a769bfe4178ca00c0dcd22a9 or later.

### How do I check if I'm affected by CVE-2022-49360?

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/ef221b738b26d8c9f7e7967f4586db2dd3bd5288>
- patch: <https://git.kernel.org/stable/c/c9e4cd5b0ccd7168801d6a811919171b185c5cf8>
- patch: <https://git.kernel.org/stable/c/071b1269a3b3ad9cec16ed76a48015bfffd9aee8>
- patch: <https://git.kernel.org/stable/c/cc8c9df19971e59ebbe669ce710080e347dfec32>
- patch: <https://git.kernel.org/stable/c/6b8beca0edd32075a769bfe4178ca00c0dcd22a9>

## 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-2022-49360>

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