CVE-2023-54124 in Linuxinfo

Summary

by MITRE • 12/24/2025

In the Linux kernel, the following vulnerability has been resolved:

f2fs: fix to drop all dirty pages during umount() if cp_error is set

xfstest generic/361 reports a bug as below:

f2fs_bug_on(sbi, sbi->fsync_node_num);

kernel BUG at fs/f2fs/super.c:1627! RIP: 0010:f2fs_put_super+0x3a8/0x3b0 Call Trace: generic_shutdown_super+0x8c/0x1b0 kill_block_super+0x2b/0x60 kill_f2fs_super+0x87/0x110 deactivate_locked_super+0x39/0x80 deactivate_super+0x46/0x50 cleanup_mnt+0x109/0x170 __cleanup_mnt+0x16/0x20 task_work_run+0x65/0xa0 exit_to_user_mode_prepare+0x175/0x190 syscall_exit_to_user_mode+0x25/0x50 do_syscall_64+0x4c/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc

During umount(), if cp_error is set, f2fs_wait_on_all_pages() should not stop waiting all F2FS_WB_CP_DATA pages to be writebacked, otherwise, fsync_node_num can be non-zero after f2fs_wait_on_all_pages() causing this bug.

In this case, to avoid deadloop in f2fs_wait_on_all_pages(), it needs to drop all dirty pages rather than redirtying them.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 01/03/2026

The vulnerability CVE-2023-54124 represents a critical flaw in the Linux kernel's F2FS (Flash-Friendly File System) implementation that manifests during unmount operations when a checkpoint error is detected. This issue stems from improper handling of dirty pages during filesystem shutdown procedures, creating a potential deadlock condition that can lead to system instability. The problem specifically affects the f2fs_put_super function which is responsible for cleaning up filesystem resources during unmount operations, where the kernel encounters a scenario that violates expected operational constraints.

The technical root cause lies in the f2fs_wait_on_all_pages() function's behavior when cp_error (checkpoint error) is set during filesystem unmount. Under normal circumstances, this function should wait for all dirty pages to be properly written back to storage before proceeding with cleanup operations. However, when a checkpoint error occurs, the function fails to properly handle F2FS_WB_CP_DATA pages, leading to a situation where fsync_node_num remains non-zero after page waiting operations complete. This condition triggers a kernel BUG at fs/f2fs/super.c:1627, as evidenced by the call trace showing generic_shutdown_super followed by kill_f2fs_super and ultimately f2fs_put_super execution.

This vulnerability directly relates to CWE-835, which describes the weakness of infinite loops in software, and aligns with ATT&CK technique T1489, which involves system shutdown/reboot to disrupt operations. The operational impact extends beyond simple system hangs to potentially corrupt filesystem metadata and data integrity, particularly when the filesystem is in a degraded state due to checkpoint errors. The issue creates a dangerous scenario where the filesystem cannot properly shut down, leading to resource leaks and potential data loss. When the kernel encounters the bug condition, it triggers an immediate system crash through the kernel BUG mechanism, effectively causing a denial of service condition that affects the entire system's stability.

The recommended mitigation strategy involves ensuring that during unmount operations when checkpoint errors are detected, the filesystem properly drops all dirty pages rather than attempting to redirty them and continue waiting. This approach prevents the infinite loop condition that occurs when fsync_node_num remains non-zero, thereby allowing the unmount process to complete successfully. System administrators should prioritize applying the kernel patch that addresses this specific race condition, particularly on systems running F2FS filesystems where checkpoint errors might occur due to power failures, hardware issues, or other storage-related anomalies. The fix essentially modifies the page handling logic to ensure that when checkpoint errors are present, the filesystem takes a more aggressive approach to clearing dirty pages, preventing the deadlock condition that leads to the kernel BUG and system crash.

Responsible

Linux

Reservation

12/24/2025

Disclosure

12/24/2025

Moderation

accepted

CPE

ready

EPSS

0.00187

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!