Skip to main content

CVE-2024-42297: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-42297cvecve-2024-42297
Published: Sat Aug 17 2024 (08/17/2024, 09:09:05 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: f2fs: fix to don't dirty inode for readonly filesystem syzbot reports f2fs bug as below: kernel BUG at fs/f2fs/inode.c:933! RIP: 0010:f2fs_evict_inode+0x1576/0x1590 fs/f2fs/inode.c:933 Call Trace: evict+0x2a4/0x620 fs/inode.c:664 dispose_list fs/inode.c:697 [inline] evict_inodes+0x5f8/0x690 fs/inode.c:747 generic_shutdown_super+0x9d/0x2c0 fs/super.c:675 kill_block_super+0x44/0x90 fs/super.c:1667 kill_f2fs_super+0x303/0x3b0 fs/f2fs/super.c:4894 deactivate_locked_super+0xc1/0x130 fs/super.c:484 cleanup_mnt+0x426/0x4c0 fs/namespace.c:1256 task_work_run+0x24a/0x300 kernel/task_work.c:180 ptrace_notify+0x2cd/0x380 kernel/signal.c:2399 ptrace_report_syscall include/linux/ptrace.h:411 [inline] ptrace_report_syscall_exit include/linux/ptrace.h:473 [inline] syscall_exit_work kernel/entry/common.c:251 [inline] syscall_exit_to_user_mode_prepare kernel/entry/common.c:278 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x15c/0x280 kernel/entry/common.c:296 do_syscall_64+0x50/0x110 arch/x86/entry/common.c:88 entry_SYSCALL_64_after_hwframe+0x63/0x6b The root cause is: - do_sys_open - f2fs_lookup - __f2fs_find_entry - f2fs_i_depth_write - f2fs_mark_inode_dirty_sync - f2fs_dirty_inode - set_inode_flag(inode, FI_DIRTY_INODE) - umount - kill_f2fs_super - kill_block_super - generic_shutdown_super - sync_filesystem : sb is readonly, skip sync_filesystem() - evict_inodes - iput - f2fs_evict_inode - f2fs_bug_on(sbi, is_inode_flag_set(inode, FI_DIRTY_INODE)) : trigger kernel panic When we try to repair i_current_depth in readonly filesystem, let's skip dirty inode to avoid panic in later f2fs_evict_inode().

AI-Powered Analysis

AILast updated: 06/29/2025, 06:56:16 UTC

Technical Analysis

CVE-2024-42297 is a vulnerability in the Linux kernel's F2FS (Flash-Friendly File System) implementation. The issue arises from improper handling of inode states during operations on read-only filesystems. Specifically, the vulnerability is triggered when the kernel attempts to mark an inode as dirty (modified) on a read-only filesystem, which should not happen. The root cause is a logic flaw in the sequence of functions involved in inode eviction and filesystem unmounting. During the unmount process, the kernel skips syncing the filesystem if it is read-only, but later in the inode eviction phase, it attempts to mark the inode as dirty, leading to a kernel BUG and panic. The stack trace indicates the panic occurs in the f2fs_evict_inode function, where a check fails because the inode is unexpectedly flagged as dirty. This results in a kernel panic, causing a denial of service (DoS) condition. The fix involves skipping the dirty inode marking step when the filesystem is read-only, preventing the panic. This vulnerability affects Linux kernel versions containing the specified commit hash (1da177e4c3f41524e886b7f1b8a0c1fc7321cac2) and likely other versions with similar F2FS code. There are no known exploits in the wild at the time of publication, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, this vulnerability primarily poses a risk of denial of service due to kernel panics on systems using the F2FS filesystem on read-only mounts. F2FS is optimized for flash storage devices and is commonly used in embedded systems, mobile devices, and some server environments. Organizations relying on Linux systems with F2FS, especially those using read-only mounts for security or operational reasons, could experience unexpected system crashes, leading to service interruptions, potential data unavailability, and operational disruptions. While this vulnerability does not directly lead to privilege escalation or data corruption, the resulting instability could affect critical infrastructure, industrial control systems, or cloud services running Linux with F2FS. The impact is more severe in environments where uptime and availability are critical, such as telecommunications, finance, healthcare, and government services. Additionally, recovery from kernel panics may require manual intervention, increasing operational costs and downtime.

Mitigation Recommendations

1. Apply the official Linux kernel patches that address CVE-2024-42297 as soon as they become available. Monitor Linux kernel mailing lists and vendor advisories for updates. 2. Identify and inventory all Linux systems using the F2FS filesystem, particularly those with read-only mounts. 3. Where possible, avoid mounting F2FS filesystems as read-only until patched, or consider remounting as read-write if operationally feasible and safe. 4. Implement robust monitoring and alerting for kernel panics and system crashes to enable rapid detection and response. 5. For embedded or specialized devices using F2FS, coordinate with device vendors for firmware or kernel updates. 6. In environments where patching is delayed, consider isolating affected systems or using alternative filesystems to mitigate risk. 7. Conduct thorough testing of patches in staging environments to ensure stability before production deployment. 8. Maintain regular backups and disaster recovery plans to minimize impact from unexpected downtime.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-07-30T07:40:12.269Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9828c4522896dcbe1e8a

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

Last enriched: 6/29/2025, 6:56:16 AM

Last updated: 8/13/2025, 6:54:52 AM

Views: 11

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