CVE-2025-22127
Executive Summary
CVE-2025-22127 fixes a deadlock in the Linux kernel’s f2fs filesystem caused by prepare_compress_overwrite() looping on IO errors while reading compressed clusters, which blocks writeback tasks and can hang the system during xfstests. The patch adds f2fs_handle_page_eio() to detect IO errors and early error detection in f2fs_read_multi_pages(), preventing the deadlock and restoring stability for f2fs compression workloads.
Authoritative CVE Metadata - CVSS Base Score: 5.5 (MEDIUM) - Published: 2025-04-16T15:16:06.813 - Last Modified: 2026-09-07T16:17:27.510
Original 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:
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().
"A true friend is the most precious of all possessions and the one we take the least thought about acquiring."
— Francois de La Rochefoucauld