Vulnerability · Published Feb 26, 2025 · Assigned by Linux
CVE-2022-49360f2fs: fix to do sanity check on total_data_blocks
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.3% (higher than 18% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | 5.18.5-1 | DEBIAN-CVE-2022-49360 |
| Debian:13 | linux | 5.18.5-1 | DEBIAN-CVE-2022-49360 |
| Debian:14 | linux | 5.18.5-1 | DEBIAN-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux | 5.15.0-47.51 | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1019.23 | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-azure | 5.15.0-1019.24 | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1017.23 | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1015.18 | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1002.4 | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1013.15 | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1015.20 | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1017.21 | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-47.53 | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1007.7 | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-oracle | 5.15.0-1017.22 | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-raspi | 5.15.0-1014.16 | UBUNTU-CVE-2022-49360 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2022-49360 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2022-49360 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 351df4b201157351c7d26bf12c3eeb9dbce98854 – before ef221b738b26d8c9f7e7967f4586db2dd3bd5288351df4b201157351c7d26bf12c3eeb9dbce98854 – before c9e4cd5b0ccd7168801d6a811919171b185c5cf8351df4b201157351c7d26bf12c3eeb9dbce98854 – before 071b1269a3b3ad9cec16ed76a48015bfffd9aee8351df4b201157351c7d26bf12c3eeb9dbce98854 – before cc8c9df19971e59ebbe669ce710080e347dfec32351df4b201157351c7d26bf12c3eeb9dbce98854 – before 6b8beca0edd32075a769bfe4178ca00c0dcd22a9 |
| Linux | Linux | 3.8 |
References
- https://git.kernel.org/stable/c/ef221b738b26d8c9f7e7967f4586db2dd3bd5288
- https://git.kernel.org/stable/c/c9e4cd5b0ccd7168801d6a811919171b185c5cf8
- https://git.kernel.org/stable/c/071b1269a3b3ad9cec16ed76a48015bfffd9aee8
- https://git.kernel.org/stable/c/cc8c9df19971e59ebbe669ce710080e347dfec32
- https://git.kernel.org/stable/c/6b8beca0edd32075a769bfe4178ca00c0dcd22a9