CVE-2025-22127: Vulnerability in Linux Linux
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().
AI Analysis
Technical Summary
CVE-2025-22127 is a vulnerability identified in the Linux kernel's F2FS (Flash-Friendly File System) implementation, specifically within the function prepare_compress_overwrite(). The issue manifests as a potential deadloop caused by the function repeatedly attempting to read compressed cluster pages when an I/O error occurs. This deadloop happens because the function holds the .writepages lock during this operation, which blocks all other writeback tasks, leading to a kernel hang or system freeze. The vulnerability was discovered during testing with xfstests on linux-next kernel versions 6.12 and 6.14.0-rc3, where the fsstress process became blocked indefinitely. The root cause is that when the generic/475 test loads an error table to a device mapper (dm) device, the function f2fs_prepare_compress_overwrite() loops due to persistent I/O errors without releasing the lock, causing a system-wide writeback stall. The fix involves adding error detection and handling mechanisms: specifically, the introduction of f2fs_handle_page_eio() to detect I/O errors early and modifications to detect cp_error earlier in f2fs_read_multi_pages(). This prevents the infinite loop and allows the system to recover from I/O errors gracefully. The vulnerability affects Linux kernel versions prior to the patch and is particularly relevant for systems using F2FS with compression enabled and specific mount options that include compression extensions. No known exploits are reported in the wild as of publication.
Potential Impact
For European organizations, this vulnerability poses a risk primarily to servers and embedded systems running Linux kernels with F2FS enabled and compression features active. The impact is a potential denial of service (DoS) condition where critical systems may hang or become unresponsive due to kernel deadlocks during writeback operations. This can disrupt services, cause data loss if systems are forcibly rebooted, and degrade operational reliability. Organizations relying on Linux-based storage solutions, especially those using F2FS on flash storage devices with compression, may experience system instability or outages. The vulnerability does not appear to allow privilege escalation or remote code execution but can severely impact availability and system integrity. Given the widespread use of Linux in European data centers, cloud infrastructure, and embedded devices, the risk is significant for sectors requiring high availability such as finance, telecommunications, and critical infrastructure. However, the exploit requires specific filesystem configurations and workloads to trigger, somewhat limiting the attack surface.
Mitigation Recommendations
European organizations should promptly update their Linux kernels to versions that include the patch for CVE-2025-22127 once available. In the interim, administrators should audit systems for the use of F2FS with compression enabled and consider disabling compression or mounting with options that avoid compress_extension features if feasible. Monitoring kernel logs for hung task messages related to writeback and kworker threads can help identify potential occurrences of this issue. For systems where patching is delayed, implementing workload adjustments to avoid triggering the problematic test conditions (e.g., avoiding heavy compression writeback under error conditions) may reduce risk. Additionally, organizations should ensure robust backup and recovery procedures are in place to mitigate potential data loss from forced reboots. Coordination with Linux distribution vendors for timely patch deployment and validation in production environments is critical. Finally, consider isolating critical systems using F2FS from untrusted or error-prone storage devices to minimize I/O error exposure.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Poland, Italy, Spain
CVE-2025-22127: Vulnerability in Linux Linux
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().
AI-Powered Analysis
Technical Analysis
CVE-2025-22127 is a vulnerability identified in the Linux kernel's F2FS (Flash-Friendly File System) implementation, specifically within the function prepare_compress_overwrite(). The issue manifests as a potential deadloop caused by the function repeatedly attempting to read compressed cluster pages when an I/O error occurs. This deadloop happens because the function holds the .writepages lock during this operation, which blocks all other writeback tasks, leading to a kernel hang or system freeze. The vulnerability was discovered during testing with xfstests on linux-next kernel versions 6.12 and 6.14.0-rc3, where the fsstress process became blocked indefinitely. The root cause is that when the generic/475 test loads an error table to a device mapper (dm) device, the function f2fs_prepare_compress_overwrite() loops due to persistent I/O errors without releasing the lock, causing a system-wide writeback stall. The fix involves adding error detection and handling mechanisms: specifically, the introduction of f2fs_handle_page_eio() to detect I/O errors early and modifications to detect cp_error earlier in f2fs_read_multi_pages(). This prevents the infinite loop and allows the system to recover from I/O errors gracefully. The vulnerability affects Linux kernel versions prior to the patch and is particularly relevant for systems using F2FS with compression enabled and specific mount options that include compression extensions. No known exploits are reported in the wild as of publication.
Potential Impact
For European organizations, this vulnerability poses a risk primarily to servers and embedded systems running Linux kernels with F2FS enabled and compression features active. The impact is a potential denial of service (DoS) condition where critical systems may hang or become unresponsive due to kernel deadlocks during writeback operations. This can disrupt services, cause data loss if systems are forcibly rebooted, and degrade operational reliability. Organizations relying on Linux-based storage solutions, especially those using F2FS on flash storage devices with compression, may experience system instability or outages. The vulnerability does not appear to allow privilege escalation or remote code execution but can severely impact availability and system integrity. Given the widespread use of Linux in European data centers, cloud infrastructure, and embedded devices, the risk is significant for sectors requiring high availability such as finance, telecommunications, and critical infrastructure. However, the exploit requires specific filesystem configurations and workloads to trigger, somewhat limiting the attack surface.
Mitigation Recommendations
European organizations should promptly update their Linux kernels to versions that include the patch for CVE-2025-22127 once available. In the interim, administrators should audit systems for the use of F2FS with compression enabled and consider disabling compression or mounting with options that avoid compress_extension features if feasible. Monitoring kernel logs for hung task messages related to writeback and kworker threads can help identify potential occurrences of this issue. For systems where patching is delayed, implementing workload adjustments to avoid triggering the problematic test conditions (e.g., avoiding heavy compression writeback under error conditions) may reduce risk. Additionally, organizations should ensure robust backup and recovery procedures are in place to mitigate potential data loss from forced reboots. Coordination with Linux distribution vendors for timely patch deployment and validation in production environments is critical. Finally, consider isolating critical systems using F2FS from untrusted or error-prone storage devices to minimize I/O error exposure.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- Linux
- Date Reserved
- 2024-12-29T08:45:45.824Z
- Cisa Enriched
- false
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682d9832c4522896dcbe81d8
Added to database: 5/21/2025, 9:09:06 AM
Last enriched: 7/3/2025, 9:43:20 PM
Last updated: 8/1/2025, 3:07:40 PM
Views: 14
Related Threats
CVE-2025-40770: CWE-300: Channel Accessible by Non-Endpoint in Siemens SINEC Traffic Analyzer
HighCVE-2025-40769: CWE-1164: Irrelevant Code in Siemens SINEC Traffic Analyzer
HighCVE-2025-40768: CWE-200: Exposure of Sensitive Information to an Unauthorized Actor in Siemens SINEC Traffic Analyzer
HighCVE-2025-40767: CWE-250: Execution with Unnecessary Privileges in Siemens SINEC Traffic Analyzer
HighCVE-2025-40766: CWE-400: Uncontrolled Resource Consumption in Siemens SINEC Traffic Analyzer
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.