Skip to main content

CVE-2024-47689: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-47689cvecve-2024-47689
Published: Mon Oct 21 2024 (10/21/2024, 11:53:29 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: f2fs: fix to don't set SB_RDONLY in f2fs_handle_critical_error() syzbot reports a f2fs bug as below: ------------[ cut here ]------------ WARNING: CPU: 1 PID: 58 at kernel/rcu/sync.c:177 rcu_sync_dtor+0xcd/0x180 kernel/rcu/sync.c:177 CPU: 1 UID: 0 PID: 58 Comm: kworker/1:2 Not tainted 6.10.0-syzkaller-12562-g1722389b0d86 #0 Workqueue: events destroy_super_work RIP: 0010:rcu_sync_dtor+0xcd/0x180 kernel/rcu/sync.c:177 Call Trace: percpu_free_rwsem+0x41/0x80 kernel/locking/percpu-rwsem.c:42 destroy_super_work+0xec/0x130 fs/super.c:282 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd40 kernel/workqueue.c:3390 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 As Christian Brauner pointed out [1]: the root cause is f2fs sets SB_RDONLY flag in internal function, rather than setting the flag covered w/ sb->s_umount semaphore via remount procedure, then below race condition causes this bug: - freeze_super() - sb_wait_write(sb, SB_FREEZE_WRITE) - sb_wait_write(sb, SB_FREEZE_PAGEFAULT) - sb_wait_write(sb, SB_FREEZE_FS) - f2fs_handle_critical_error - sb->s_flags |= SB_RDONLY - thaw_super - thaw_super_locked - sb_rdonly() is true, so it skips sb_freeze_unlock(sb, SB_FREEZE_FS) - deactivate_locked_super Since f2fs has almost the same logic as ext4 [2] when handling critical error in filesystem if it mounts w/ errors=remount-ro option: - set CP_ERROR_FLAG flag which indicates filesystem is stopped - record errors to superblock - set SB_RDONLY falg Once we set CP_ERROR_FLAG flag, all writable interfaces can detect the flag and stop any further updates on filesystem. So, it is safe to not set SB_RDONLY flag, let's remove the logic and keep in line w/ ext4 [3]. [1] https://lore.kernel.org/all/20240729-himbeeren-funknetz-96e62f9c7aee@brauner [2] https://lore.kernel.org/all/20240729132721.hxih6ehigadqf7wx@quack3 [3] https://lore.kernel.org/linux-ext4/20240805201241.27286-1-jack@suse.cz

AI-Powered Analysis

AILast updated: 06/27/2025, 21:26:55 UTC

Technical Analysis

CVE-2024-47689 addresses a vulnerability in the Linux kernel's handling of the f2fs (Flash-Friendly File System) filesystem, specifically related to the management of the SB_RDONLY flag during critical error handling. The issue arises because the f2fs filesystem sets the SB_RDONLY (superblock read-only) flag directly within an internal function (f2fs_handle_critical_error) without properly synchronizing this action with the sb->s_umount semaphore via the remount procedure. This leads to a race condition involving freeze_super() and thaw_super() operations on the filesystem. The race condition manifests as improper handling of the superblock's read-only state, where thaw_super_locked() detects the SB_RDONLY flag and skips unlocking the freeze state (sb_freeze_unlock), potentially causing deadlocks or inconsistent filesystem states. The root cause is that f2fs deviates from the approach used by ext4, which sets a CP_ERROR_FLAG to indicate the filesystem is stopped and relies on this flag to prevent further writes, rather than directly setting SB_RDONLY. The patch removes the direct setting of SB_RDONLY in favor of relying on CP_ERROR_FLAG, aligning f2fs behavior with ext4 and preventing the race condition. The vulnerability was identified through syzbot reports and kernel tracebacks, highlighting kernel warnings and call traces related to rcu_sync_dtor and workqueue processing. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet. The affected Linux kernel versions include specific commits identified by their hashes, indicating the issue is present in recent kernel builds prior to the fix. This vulnerability impacts the stability and reliability of systems using f2fs, particularly under error conditions where the filesystem is remounted read-only due to critical errors.

Potential Impact

For European organizations, the vulnerability poses risks primarily to systems using the f2fs filesystem, which is commonly employed in embedded devices, mobile devices, and some specialized Linux environments. The race condition and improper handling of the SB_RDONLY flag can lead to filesystem deadlocks, data corruption, or system instability during critical error scenarios. This can affect availability and integrity of data on affected systems. Organizations relying on Linux servers, IoT devices, or embedded systems with f2fs may experience unexpected system crashes or require manual intervention to recover from filesystem errors. While the vulnerability does not directly expose confidentiality risks or remote code execution, the potential for data loss or downtime can disrupt business operations, particularly in sectors with critical infrastructure or real-time data processing. The absence of known exploits reduces immediate threat levels, but the complexity of the bug and its presence in kernel code means that sophisticated attackers or accidental triggers could cause denial-of-service conditions. European organizations with large Linux deployments, especially those in telecommunications, automotive, or industrial control systems using f2fs, should consider the impact carefully.

Mitigation Recommendations

1. Apply the official Linux kernel patches that address CVE-2024-47689 as soon as they become available from trusted Linux distribution vendors or the mainline kernel repository. 2. For systems where immediate patching is not feasible, consider avoiding the use of f2fs or remounting filesystems with the errors=remount-ro option disabled to prevent triggering the vulnerable code path. 3. Implement robust monitoring of filesystem health and kernel logs to detect early signs of filesystem errors or deadlocks related to f2fs. 4. For embedded and IoT devices, coordinate with hardware vendors to ensure firmware and kernel updates include the fix. 5. Conduct thorough testing of critical systems after patching to verify stability and absence of regressions related to filesystem operations. 6. Maintain regular backups of data stored on f2fs filesystems to mitigate potential data loss from filesystem corruption. 7. Limit administrative access to systems running vulnerable kernels to reduce the risk of accidental or malicious triggering of the bug. 8. Engage with Linux vendor support channels for guidance on backporting patches if using long-term support kernels.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-09-30T16:00:12.941Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9820c4522896dcbdce47

Added to database: 5/21/2025, 9:08:48 AM

Last enriched: 6/27/2025, 9:26:55 PM

Last updated: 7/31/2025, 4:15:27 AM

Views: 13

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats