Cloudanix VulnDB

CVE-2025-22127

Medium · 5.5

CVSS

5.5

EPSS

0.2%

Published

Apr 16, 2025

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A bug in certain Linux file-system code could cause the whole system to freeze when storage errors occur during compressed writes, and the fix has been included in updated Ceph storage packages.

Exploitation
Local Privilege
Attacker needs
Local User
Complexity
Moderate
Impact
Denial Of Service
Component
OS kernel
Class
Denial of service
Remediation
Patch
Effort
Medium
Patch risk
Low

What it actually does

Infinite loop in f2fs_prepare_compress_overwrite() when reading compressed cluster pages encounters IO errors while holding the writepages lock, preventing other writeback tasks from progressing.

Why it matters to the business

File system operations using f2fs compression can hang indefinitely under IO error conditions, causing system-wide writeback stalls and potential denial of service in affected Ceph storage deployments.

How an attack unfolds

An attacker or faulty condition triggers IO errors on f2fs compressed clusters (for example by loading an error table into a dm device), causing prepare_compress_overwrite to loop indefinitely while holding locks; this blocks all concurrent writeback and leads to kernel task hangs.

How to fix it

Upgrade affected Ceph packages to the fixed versions listed (for example ceph 2:19.2.0-55.el9cp and corresponding packages); apply the upstream kernel fix for f2fs_handle_page_eio and early cp_error detection in f2fs_read_multi_pages if rebuilding kernels.

How to confirm the fix worked

Confirm package versions match or exceed the fixed releases; reproduce the original xfstests generic/475 workload with compression and error injection to verify no hang occurs; monitor for absence of prolonged mutex contention in __f2fs_write_data_pages.

Typical attack path

  1. Mount f2fs filesystem with compression enabled
  2. Induce IO errors on compressed data clusters
  3. Trigger writeback activity that enters prepare_compress_overwrite
  4. Hold writepages lock while looping on error pages
  5. Starve other writeback workers causing system hang

How to detect it

Search kernel logs and dmesg for hung_task_timeout messages mentioning __f2fs_write_data_pages or kworker writeback; inspect f2fs mount options for compression and any preceding IO error or dm error table activity.

What your security team should do

  • Prioritize upgrade of all listed Ceph packages to the stated fixed versions within the next maintenance window
  • Enable f2fs compression only on storage where IO error handling can be monitored
  • Review kernel logs for hung_task warnings related to f2fs writeback after deployment

The record

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

Ecosystem Package Introduced Fixed
Chainguard hyperv-daemons-6.12 0 6.12.57-r0
Chainguard linux-aws-6.12-boot-installed 0 6.12.57-r0
Chainguard linux-aws-6.12-fips-boot-installed 0 6.12.57-r0
Chainguard linux-aws-6.12-headers 0 6.12.57-r1
Chainguard linux-aws-6.12-modules 0 6.12.57-r0
Chainguard linux-azure-6.12-boot-installed 0 6.12.57-r0
Chainguard linux-azure-6.12-fips-boot-installed 0 6.12.57-r0
Chainguard linux-azure-6.12-headers 0 6.12.57-r1
Chainguard linux-azure-6.12-modules 0 6.12.57-r0
Chainguard linux-gcp-6.12-boot-installed 0 6.12.57-r0
Chainguard linux-gcp-6.12-fips-boot-installed 0 6.12.57-r0
Chainguard linux-gcp-6.12-headers 0 6.12.57-r1
Chainguard linux-gcp-6.12-modules 0 6.12.57-r1
Chainguard linux-qemu-6.12-boot-installed 0 6.12.63-r0
Chainguard linux-qemu-6.12-fips-boot-installed 0 6.12.63-r0
Chainguard linux-qemu-6.12-headers 0 6.12.63-r0
Chainguard linux-qemu-6.12-modules 0 6.12.63-r0
Chainguard linux-vmware-6.12 0 6.12.67-r0
Chainguard linux-vmware-6.12-boot-installed 0 6.12.63-r0
Chainguard linux-vmware-6.12-fips-boot-installed 0 6.12.63-r0
Chainguard linux-vmware-6.12-headers 0 6.12.63-r0
Chainguard linux-vmware-6.12-modules 0 6.12.63-r0
Debian:11 linux 0 No fix
Debian:12 linux 0 No fix
Debian:13 linux 0 No fix
Debian:14 linux 0 6.16.3-1
Linux Kernel 5.6.0 6.14.2

Related vulnerabilities