CVE-2024-47689: f2fs: fix to don't set SB_RDONLY in f2fs_handle_critical_error()

Published Oct 21, 2024
·
Updated

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

f2fs: fix to don't set SBRDONLY in f2fshandlecriticalerror()

syzbot reports a f2fs bug as below:

------------[ cut here ]------------ WARNING: CPU: 1 PID: 58 at kernel/rcu/sync.c:177 rcusyncdtor+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 destroysuperwork RIP: 0010:rcusyncdtor+0xcd/0x180 kernel/rcu/sync.c:177 Call Trace: percpufreerwsem+0x41/0x80 kernel/locking/percpu-rwsem.c:42 destroysuperwork+0xec/0x130 fs/super.c:282 processonework kernel/workqueue.c:3231 [inline] processscheduledworks+0xa2c/0x1830 kernel/workqueue.c:3312 workerthread+0x86d/0xd40 kernel/workqueue.c:3390 kthread+0x2f0/0x390 kernel/kthread.c:389 retfromfork+0x4b/0x80 arch/x86/kernel/process.c:147 retfromforkasm+0x1a/0x30 arch/x86/entry/entry64.S:244

As Christian Brauner pointed out [1]: the root cause is f2fs sets SBRDONLY flag in internal function, rather than setting the flag covered w/ sb->sumount semaphore via remount procedure, then below race condition causes this bug:

- freezesuper() - sbwaitwrite(sb, SBFREEZEWRITE) - sbwaitwrite(sb, SBFREEZEPAGEFAULT) - sbwaitwrite(sb, SBFREEZEFS) - f2fshandlecriticalerror - sb->sflags |= SBRDONLY - thawsuper - thawsuperlocked - sbrdonly() is true, so it skips sbfreezeunlock(sb, SBFREEZEFS) - deactivatelockedsuper

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 CPERRORFLAG flag which indicates filesystem is stopped - record errors to superblock - set SBRDONLY falg Once we set CPERRORFLAG flag, all writable interfaces can detect the flag and stop any further updates on filesystem. So, it is safe to not set SBRDONLY 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

Other sources

This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.

Launchpad

Affected Software

5 affected componentsFixes available
Linux Linux kernel>=6.4.4<6.5
Linux Linux kernel>=6.5<6.6.54
Linux Linux kernel>=6.7<6.10.13
Linux Linux kernel>=6.11<6.11.2
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1

Event History

Oct 21, 2024
CVE Published
via MITRE·11:53 AM
Data Sourced
via MITRE·11:53 AM
Description
Feb 20, 2025
Data Sourced
via Launchpad·12:49 AM
Description
May 11, 2025
Data Sourced
via Ubuntu·01:06 AM
RemedyDescriptionSeverityAffected Software
Data Sourced
via Debian·01:06 AM
DescriptionAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-47689?

CVE-2024-47689 is a critical vulnerability in the Linux kernel that affects the handling of F2FS critical errors.

2

How do I fix CVE-2024-47689?

To fix CVE-2024-47689, update to a patched version of the Linux kernel, such as those listed in the vulnerability documentation.

3

Which Linux kernel versions are affected by CVE-2024-47689?

CVE-2024-47689 affects Linux kernel versions from 6.4.4 up to 6.11.2, and some versions within those ranges.

4

What component of the Linux kernel does CVE-2024-47689 impact?

CVE-2024-47689 impacts the F2FS filesystem within the Linux kernel, particularly the error handling mechanisms.

5

Are there any known exploits for CVE-2024-47689?

As of now, there are no widely reported exploits for CVE-2024-47689, but it is important to apply security patches promptly.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203