CVE-2022-49360

f2fs: fix to do sanity check on total_data_blocks

No CVSS score yet EPSS 0.26%

Published 26 Feb 2025 Updated 15 Aug 2026 CNA: Linux

Check your servers for CVE-2022-49360

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2022-49360 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

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.

Exploitation

EPSS 0.26%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 19.1% of all scored CVEs. Scores of 1 Dec 2026.

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from 351df4b201157351c7d26bf12c3eeb9dbce98854, before ef221b738b26d8c9f7e7967f4586db2dd3bd5288
affected from 351df4b201157351c7d26bf12c3eeb9dbce98854, before c9e4cd5b0ccd7168801d6a811919171b185c5cf8
affected from 351df4b201157351c7d26bf12c3eeb9dbce98854, before 071b1269a3b3ad9cec16ed76a48015bfffd9aee8
affected from 351df4b201157351c7d26bf12c3eeb9dbce98854, before cc8c9df19971e59ebbe669ce710080e347dfec32
affected from 351df4b201157351c7d26bf12c3eeb9dbce98854, before 6b8beca0edd32075a769bfe4178ca00c0dcd22a9
Other versions: unaffected
Linux
affected 3.8
unaffected before 3.8
unaffected from 5.10.121 up to and including 5.10.*
unaffected from 5.15.46 up to and including 5.15.*
unaffected from 5.17.14 up to and including 5.17.*
unaffected from 5.18.3 up to and including 5.18.*
unaffected 5.19 and later
Other versions: affected

Is my server affected?

This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:

uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2022-49360 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2022-49360

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2022-49360
trivy image --scanners vuln IMAGE | grep CVE-2022-49360

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2022-49360 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.