In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to avoid potential deadlock in f2fsrecordstop_reason()
syzbot reports deadlock issue of f2fs as below:
====================================================== WARNING: possible circular locking dependency detected
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: f2fsrecordstop_reason+0x52/0x1d0 fs/f2fs/super.c:4068
but task is already holding lock: ffff88804bd92610 (sbinternal#2){.+.+}-{0:0}, at: f2fsevict_inode+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---
[
{
"id": "CVE-2024-56744-03f9ab35",
"target": {
"file": "fs/f2fs/f2fs.h"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"60921687907303375786930754589436972421",
"193915965740274302729085586985885722510",
"78768346774117559670719501235960754305",
"114024768992529327462793167847054552042",
"24272174050443713249986714967600251649"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ecf4e6782b01fd578b565b3dd2be7bb0ac91082e",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-04bdf4d3",
"target": {
"file": "fs/f2fs/super.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"192386498981101452112380163798378705036",
"88596855097924582595549052855883471205",
"99304443903582446758423365096010755514",
"271241669353272819481758288464382377668",
"40964902230852603820633775506251134133",
"147037857055842940773061108061611061297",
"219547381920140424176107105176870070612",
"289995079581238732637852653542266545132",
"318341529062580110364054196687872794918",
"275459244796537278285004448720348720562",
"178693581290130485625855241788591742769",
"121541716369816842159825758587744485172"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1539a088b108996bcdaddb7775070b5163b14233",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-397ac677",
"target": {
"file": "fs/f2fs/super.c",
"function": "f2fs_handle_critical_error"
},
"digest": {
"length": 843.0,
"function_hash": "83085907519255006236745332673558302588"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ecf4e6782b01fd578b565b3dd2be7bb0ac91082e",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-3bb05234",
"target": {
"file": "fs/f2fs/checkpoint.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"287646944285083068761029306662452322956",
"84732627192803403709112138882668461870",
"48309649448605849514199213536951669414",
"213862178174848898211189087901790149299"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f10a890308a7cd8794e21f646f09827c6cb4bf5d",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-46b7883b",
"target": {
"file": "fs/f2fs/super.c",
"function": "f2fs_handle_critical_error"
},
"digest": {
"length": 843.0,
"function_hash": "83085907519255006236745332673558302588"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f10a890308a7cd8794e21f646f09827c6cb4bf5d",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-4f42101b",
"target": {
"file": "fs/f2fs/checkpoint.c",
"function": "f2fs_stop_checkpoint"
},
"digest": {
"length": 175.0,
"function_hash": "244800226509335081228982061918706165427"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ecf4e6782b01fd578b565b3dd2be7bb0ac91082e",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-50b27d7e",
"target": {
"file": "fs/f2fs/super.c",
"function": "f2fs_handle_critical_error"
},
"digest": {
"length": 843.0,
"function_hash": "83085907519255006236745332673558302588"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@801092a2c9c251ef6a8678fcb8fcc1220474a697",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-58f2c133",
"target": {
"file": "fs/f2fs/checkpoint.c",
"function": "f2fs_stop_checkpoint"
},
"digest": {
"length": 175.0,
"function_hash": "244800226509335081228982061918706165427"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f10a890308a7cd8794e21f646f09827c6cb4bf5d",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-61fb63ff",
"target": {
"file": "fs/f2fs/checkpoint.c",
"function": "f2fs_stop_checkpoint"
},
"digest": {
"length": 175.0,
"function_hash": "244800226509335081228982061918706165427"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@801092a2c9c251ef6a8678fcb8fcc1220474a697",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-791e569a",
"target": {
"file": "fs/f2fs/checkpoint.c",
"function": "f2fs_stop_checkpoint"
},
"digest": {
"length": 175.0,
"function_hash": "244800226509335081228982061918706165427"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1539a088b108996bcdaddb7775070b5163b14233",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-7bbf5d85",
"target": {
"file": "fs/f2fs/super.c",
"function": "f2fs_handle_critical_error"
},
"digest": {
"length": 843.0,
"function_hash": "83085907519255006236745332673558302588"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1539a088b108996bcdaddb7775070b5163b14233",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-99b9a208",
"target": {
"file": "fs/f2fs/f2fs.h"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"60921687907303375786930754589436972421",
"193915965740274302729085586985885722510",
"78768346774117559670719501235960754305",
"114024768992529327462793167847054552042",
"24272174050443713249986714967600251649"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@801092a2c9c251ef6a8678fcb8fcc1220474a697",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-9fcd9202",
"target": {
"file": "fs/f2fs/checkpoint.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"287646944285083068761029306662452322956",
"84732627192803403709112138882668461870",
"48309649448605849514199213536951669414",
"213862178174848898211189087901790149299"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ecf4e6782b01fd578b565b3dd2be7bb0ac91082e",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-a2ad6eff",
"target": {
"file": "fs/f2fs/checkpoint.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"287646944285083068761029306662452322956",
"84732627192803403709112138882668461870",
"48309649448605849514199213536951669414",
"213862178174848898211189087901790149299"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1539a088b108996bcdaddb7775070b5163b14233",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-ad10530d",
"target": {
"file": "fs/f2fs/super.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"192386498981101452112380163798378705036",
"88596855097924582595549052855883471205",
"99304443903582446758423365096010755514",
"271241669353272819481758288464382377668",
"40964902230852603820633775506251134133",
"147037857055842940773061108061611061297",
"219547381920140424176107105176870070612",
"289995079581238732637852653542266545132",
"318341529062580110364054196687872794918",
"275459244796537278285004448720348720562",
"178693581290130485625855241788591742769",
"121541716369816842159825758587744485172"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f10a890308a7cd8794e21f646f09827c6cb4bf5d",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-ad1c17fa",
"target": {
"file": "fs/f2fs/super.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"192386498981101452112380163798378705036",
"88596855097924582595549052855883471205",
"99304443903582446758423365096010755514",
"271241669353272819481758288464382377668",
"40964902230852603820633775506251134133",
"147037857055842940773061108061611061297",
"219547381920140424176107105176870070612",
"289995079581238732637852653542266545132",
"318341529062580110364054196687872794918",
"275459244796537278285004448720348720562",
"178693581290130485625855241788591742769",
"121541716369816842159825758587744485172"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@801092a2c9c251ef6a8678fcb8fcc1220474a697",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-b595511d",
"target": {
"file": "fs/f2fs/f2fs.h"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"60921687907303375786930754589436972421",
"193915965740274302729085586985885722510",
"78768346774117559670719501235960754305",
"114024768992529327462793167847054552042",
"24272174050443713249986714967600251649"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1539a088b108996bcdaddb7775070b5163b14233",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-c09c22ea",
"target": {
"file": "fs/f2fs/checkpoint.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"287646944285083068761029306662452322956",
"84732627192803403709112138882668461870",
"48309649448605849514199213536951669414",
"213862178174848898211189087901790149299"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@801092a2c9c251ef6a8678fcb8fcc1220474a697",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-dfdcf2cf",
"target": {
"file": "fs/f2fs/super.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"192386498981101452112380163798378705036",
"88596855097924582595549052855883471205",
"99304443903582446758423365096010755514",
"271241669353272819481758288464382377668",
"40964902230852603820633775506251134133",
"147037857055842940773061108061611061297",
"219547381920140424176107105176870070612",
"289995079581238732637852653542266545132",
"318341529062580110364054196687872794918",
"275459244796537278285004448720348720562",
"178693581290130485625855241788591742769",
"121541716369816842159825758587744485172"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ecf4e6782b01fd578b565b3dd2be7bb0ac91082e",
"signature_version": "v1"
},
{
"id": "CVE-2024-56744-e8119aa2",
"target": {
"file": "fs/f2fs/f2fs.h"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"60921687907303375786930754589436972421",
"193915965740274302729085586985885722510",
"78768346774117559670719501235960754305",
"114024768992529327462793167847054552042",
"24272174050443713249986714967600251649"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f10a890308a7cd8794e21f646f09827c6cb4bf5d",
"signature_version": "v1"
}
]