Vulnerability · Published Apr 16, 2025 · Assigned by Linux
CVE-2025-22127f2fs: fix potential deadloop in prepare_compress_overwrite()
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.2% (higher than 9% 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 potential deadloop in prepare_compress_overwrite() Jan Prusakowski reported a kernel hang issue as below: When running xfstests on linux-next kernel (6.14.0-rc3, 6.12) I encountered a problem in generic/475 test where fsstress process gets blocked in __f2fs_write_data_pages() and the test hangs. The options I used are: MKFS_OPTIONS -- -O compression -O extra_attr -O project_quota -O quota /dev/vdc MOUNT_OPTIONS -- -o acl,user_xattr -o discard,compress_extension=* /dev/vdc /vdc INFO: task kworker/u8:0:11 blocked for more than 122 seconds. Not tainted 6.14.0-rc3-xfstests-lockdep #1 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:kworker/u8:0 state:D stack:0 pid:11 tgid:11 ppid:2 task_flags:0x4208160 flags:0x00004000 Workqueue: writeback wb_workfn (flush-253:0) Call Trace: <TASK> __schedule+0x309/0x8e0 schedule+0x3a/0x100 schedule_preempt_disabled+0x15/0x30 __mutex_lock+0x59a/0xdb0 __f2fs_write_data_pages+0x3ac/0x400 do_writepages+0xe8/0x290 __writeback_single_inode+0x5c/0x360 writeback_sb_inodes+0x22f/0x570 wb_writeback+0xb0/0x410 wb_do_writeback+0x47/0x2f0 wb_workfn+0x5a/0x1c0 process_one_work+0x223/0x5b0 worker_thread+0x1d5/0x3c0 kthread+0xfd/0x230 ret_from_fork+0x31/0x50 ret_from_fork_asm+0x1a/0x30 </TASK> The root cause is: once generic/475 starts toload error table to dm device, f2fs_prepare_compress_overwrite() will loop reading compressed cluster pages due to IO error, meanwhile it has held .writepages lock, it can block all other writeback tasks. Let's fix this issue w/ below changes: - add f2fs_handle_page_eio() in prepare_compress_overwrite() to detect IO error. - detect cp_error earler in f2fs_read_multi_pages().
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | no fix listed | DEBIAN-CVE-2025-22127 |
| Debian:13 | linux | 6.12.111-1 | DEBIAN-CVE-2025-22127 |
| Debian:14 | linux | 6.16.3-1 | DEBIAN-CVE-2025-22127 |
| Debian:12 | linux-6.12 | 6.12.111-1~deb12u1 | DEBIAN-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-aws | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-aws | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-azure | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-azure | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-azure-6.11 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-azure-fde | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-azure-fde | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:25.10 | linux-azure-fde | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-azure-fde-6.17 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.8 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-azure-nvidia | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-gcp | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-gcp | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-gcp-6.11 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-gke | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-gke | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-gkeop | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-gkeop | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-hwe-6.11 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-ibm | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-ibm | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-intel | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-intel-iotg | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-kvm | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-lowlatency | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-lowlatency | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-lowlatency-hwe-6.11 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-nvidia | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-nvidia | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-nvidia-6.11 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-nvidia-tegra | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-oracle | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-oracle | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-raspi | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-raspi | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-vmware | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:24.04:LTS | linux-xilinx | no fix listed | UBUNTU-CVE-2025-22127 |
| Ubuntu:22.04:LTS | linux-xilinx-zynqmp | no fix listed | UBUNTU-CVE-2025-22127 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 4c8ff7095bef64fc47e996a938f7d57f9e077da3 – before 353b262268c1646a0e7c96d4ed14c5d72a30ccb44c8ff7095bef64fc47e996a938f7d57f9e077da3 – before 4513843d58d8fa1daebd3817205a15309b1463424c8ff7095bef64fc47e996a938f7d57f9e077da3 – before 7cd460bd9e7c6e6c30a33982603f65fb5deab1e44c8ff7095bef64fc47e996a938f7d57f9e077da3 – before 7215cf8ef54bdc9082dffac4662416d54961e2584c8ff7095bef64fc47e996a938f7d57f9e077da3 – before 3147ee567dd9004a49826ddeaf0a4b12865d4409 |
| Linux | Linux | 5.6 |
References
- https://git.kernel.org/stable/c/353b262268c1646a0e7c96d4ed14c5d72a30ccb4
- https://git.kernel.org/stable/c/4513843d58d8fa1daebd3817205a15309b146342
- https://git.kernel.org/stable/c/7cd460bd9e7c6e6c30a33982603f65fb5deab1e4
- https://git.kernel.org/stable/c/7215cf8ef54bdc9082dffac4662416d54961e258
- https://git.kernel.org/stable/c/3147ee567dd9004a49826ddeaf0a4b12865d4409