CVE-2023-53447: f2fs: don't reset unchangable mount option in f2fs_remount()
In the Linux kernel, the following vulnerability has been resolved:
f2fs: don't reset unchangable mount option in f2fsremount()
syzbot reports a bug as below:
general protection fault, probably for non-canonical address 0xdffffc0000000009: 0000 [#1] PREEMPT SMP KASAN RIP: 0010:lockacquire+0x69/0x2000 kernel/locking/lockdep.c:4942 Call Trace: lockacquire+0x1e3/0x520 kernel/locking/lockdep.c:5691 rawwritelock include/linux/rwlockapismp.h:209 [inline] rawwritelock+0x2e/0x40 kernel/locking/spinlock.c:300 dropextenttree+0x3ac/0x660 fs/f2fs/extentcache.c:1100 f2fsdropextenttree+0x17/0x30 fs/f2fs/extentcache.c:1116 f2fsinsertrange+0x2d5/0x3c0 fs/f2fs/file.c:1664 f2fsfallocate+0x4e4/0x6d0 fs/f2fs/file.c:1838 vfsfallocate+0x54b/0x6b0 fs/open.c:324 ksysfallocate fs/open.c:347 [inline] dosysfallocate fs/open.c:355 [inline] sesysfallocate fs/open.c:353 [inline] x64sysfallocate+0xbd/0x100 fs/open.c:353 dosyscallx64 arch/x86/entry/common.c:50 [inline] dosyscall64+0x41/0xc0 arch/x86/entry/common.c:80 entrySYSCALL64afterhwframe+0x63/0xcd
The root cause is race condition as below: - since it tries to remount rw filesystem, so that doremount won't call sbprepareremountreadonly to block fallocate, there may be race condition in between remount and fallocate. - in f2fsremount(), defaultoptions() will reset mount option to default one, and then update it based on result of parseoptions(), so there is a hole which race condition can happen.
Thread A Thread B - f2fsfillsuper - parseoptions - clearopt(READEXTENTCACHE)
- f2fsremount - defaultoptions - setopt(READEXTENTCACHE) - f2fsfallocate - f2fsinsertrange - f2fsdropextenttree - dropextenttree - mayextenttree - testopt(READEXTENTCACHE) return true - writelock(&et->lock) access NULL pointer - parseoptions - clearopt(READEXTENTCACHE)
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2023-53447?
CVE-2023-53447 has been classified as a moderate severity vulnerability in the Linux kernel.
How do I fix CVE-2023-53447?
To address CVE-2023-53447, it is recommended to apply the latest updates from the Linux kernel that contain the fix.
What versions of the Linux kernel are affected by CVE-2023-53447?
CVE-2023-53447 affects various versions of the Linux kernel, but specific version details can be found in the official patch notes.
What is the impact of CVE-2023-53447 on system security?
The impact of CVE-2023-53447 includes potential vulnerabilities that could lead to system instability or potential exploitation.
Is CVE-2023-53447 being actively exploited?
As of now, there have been no confirmed reports of active exploitation of CVE-2023-53447 in the wild.