CVE-2024-56744: f2fs: fix to avoid potential deadlock in f2fs_record_stop_reason()
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to avoid potential deadlock in f2fsrecordstopreason()
syzbot reports deadlock issue of f2fs as below:
====================================================== WARNING: possible circular locking dependency detected 6.12.0-rc3-syzkaller-00087-gc964ced77262 #0 Not tainted ------------------------------------------------------ kswapd0/79 is trying to acquire lock: ffff888011824088 (&sbi->sblock){++++}-{3:3}, at: f2fsdownwrite fs/f2fs/f2fs.h:2199 [inline] ffff888011824088 (&sbi->sblock){++++}-{3:3}, at: f2fsrecordstopreason+0x52/0x1d0 fs/f2fs/super.c:4068
but task is already holding lock: ffff88804bd92610 (sbinternal#2){.+.+}-{0:0}, at: f2fsevictinode+0x662/0x15c0 fs/f2fs/inode.c:842
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (sbinternal#2){.+.+}-{0:0}: lockacquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 percpudownread include/linux/percpu-rwsem.h:51 [inline] sbstartwrite include/linux/fs.h:1716 [inline] sbstartintwrite+0x4d/0x1c0 include/linux/fs.h:1899 f2fsevictinode+0x662/0x15c0 fs/f2fs/inode.c:842 evict+0x4e8/0x9b0 fs/inode.c:725 f2fsevictinode+0x1a4/0x15c0 fs/f2fs/inode.c:807 evict+0x4e8/0x9b0 fs/inode.c:725 disposelist fs/inode.c:774 [inline] pruneicachesb+0x239/0x2f0 fs/inode.c:963 supercachescan+0x38c/0x4b0 fs/super.c:223 doshrinkslab+0x701/0x1160 mm/shrinker.c:435 shrinkslab+0x1093/0x14d0 mm/shrinker.c:662 shrinkone+0x43b/0x850 mm/vmscan.c:4818 shrinkmany mm/vmscan.c:4879 [inline] lrugenshrinknode mm/vmscan.c:4957 [inline] shrinknode+0x3799/0x3de0 mm/vmscan.c:5937 kswapdshrinknode mm/vmscan.c:6765 [inline] balancepgdat mm/vmscan.c:6957 [inline] kswapd+0x1ca3/0x3700 mm/vmscan.c:7226 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
-> #1 (fsreclaim){+.+.}-{0:0}: lockacquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 fsreclaimacquire mm/pagealloc.c:3834 [inline] fsreclaimacquire+0x88/0x130 mm/pagealloc.c:3848 mightalloc include/linux/sched/mm.h:318 [inline] prepareallocpages+0x147/0x5b0 mm/pagealloc.c:4493 allocpagesnoprof+0x16f/0x710 mm/pagealloc.c:4722 allocpagesmpolnoprof+0x3e8/0x680 mm/mempolicy.c:2265 allocpagesnoprof mm/mempolicy.c:2345 [inline] folioallocnoprof+0x128/0x180 mm/mempolicy.c:2352 filemapallocfolionoprof+0xdf/0x500 mm/filemap.c:1010 doreadcachefolio+0x2eb/0x850 mm/filemap.c:3787 readmappingfolio include/linux/pagemap.h:1011 [inline] f2fscommitsuper+0x3c0/0x7d0 fs/f2fs/super.c:4032 f2fsrecordstopreason+0x13b/0x1d0 fs/f2fs/super.c:4079 f2fshandlecriticalerror+0x2ac/0x5c0 fs/f2fs/super.c:4174 f2fswriteinode+0x35f/0x4d0 fs/f2fs/inode.c:785 writeinode fs/fs-writeback.c:1503 [inline] writebacksingleinode+0x711/0x10d0 fs/fs-writeback.c:1723 writebacksingleinode+0x1f3/0x660 fs/fs-writeback.c:1779 syncinodemetadata+0xc4/0x120 fs/fs-writeback.c:2849 f2fsreleasefile+0xa8/0x100 fs/f2fs/file.c:1941 fput+0x23f/0x880 fs/filetable.c:431 taskworkrun+0x24f/0x310 kernel/taskwork.c:228 resumeusermodework include/linux/resumeusermode.h:50 [inline] exittousermodeloop kernel/entry/common.c:114 [inline] exittousermodeprepare include/linux/entry-common.h:328 [inline] syscallexittousermodework kernel/entry/common.c:207 [inline] syscallexittousermode+0x168/0x370 kernel/entry/common.c:218 dosyscall64+0x100/0x230 arch/x86/entry/common.c:89 entrySYSCALL64afterhwframe+0x77/0x7f
---truncated---
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
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-56744?
CVE-2024-56744 has not been assigned a severity rating, but it addresses a potential deadlock issue in the Linux kernel's f2fs file system.
How do I fix CVE-2024-56744?
To fix CVE-2024-56744, you should update your Linux kernel to a version that includes the patch for this vulnerability.
What versions of the Linux kernel are affected by CVE-2024-56744?
CVE-2024-56744 affects Linux kernel versions between 6.4.4 and 6.6.64, 6.7 and 6.11.11, and 6.12 and 6.12.2.
What is the nature of the issue described in CVE-2024-56744?
CVE-2024-56744 describes a potential circular locking dependency that could lead to a deadlock in the f2fs file system.
Is CVE-2024-56744 specific to any particular version of f2fs?
CVE-2024-56744 is related to the f2fs file system as implemented in the Linux kernel and not tied to a specific version of f2fs.