syzbot


possible deadlock in exfat_get_block

Status: auto-obsoleted due to no activity on 2023/10/19 14:45
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+3592f972960fdcc474fb@syzkaller.appspotmail.com
First crash: 622d, last: 468d
Fix bisection: failed (error log, bisect log)
  
Bug presence (2)
Date Name Commit Repro Result
2023/07/24 upstream (ToT) 6eaae1980760 C [report] possible deadlock in exfat_get_block
2023/09/07 upstream (ToT) 7ba2090ca64e C Didn't crash
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in exfat_get_block exfat C error done 317 469d 771d 0/28 auto-obsoleted due to no activity on 2023/10/21 18:47
linux-6.1 possible deadlock in exfat_get_block origin:lts-only syz unreliable 225 470d 603d 0/3 upstream: reported syz repro on 2023/03/29 01:00

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
5.15.121-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor401/15401 is trying to acquire lock:
ffff0000db8cc0e0 (&sbi->s_lock){+.+.}-{3:3}, at: exfat_get_block+0x16c/0x1b40 fs/exfat/inode.c:303

but task is already holding lock:
ffff0000df0f9150 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:842 [inline]
ffff0000df0f9150 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: page_cache_ra_unbounded+0x158/0x654 mm/readahead.c:195

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (mapping.invalidate_lock#3){.+.+}-{3:3}:
       down_read+0xc0/0x398 kernel/locking/rwsem.c:1488
       filemap_invalidate_lock_shared include/linux/fs.h:842 [inline]
       filemap_fault+0x52c/0xf5c mm/filemap.c:3072
       __do_fault+0x120/0x5d0 mm/memory.c:3898
       do_read_fault mm/memory.c:4234 [inline]
       do_fault mm/memory.c:4362 [inline]
       handle_pte_fault mm/memory.c:4621 [inline]
       __handle_mm_fault mm/memory.c:4756 [inline]
       handle_mm_fault+0x21ec/0x33c4 mm/memory.c:4854
       __do_page_fault arch/arm64/mm/fault.c:505 [inline]
       do_page_fault+0x700/0xb60 arch/arm64/mm/fault.c:605
       do_translation_fault+0xe8/0x138 arch/arm64/mm/fault.c:686
       do_mem_abort+0x70/0x1d8 arch/arm64/mm/fault.c:819
       el1_abort+0x3c/0x5c arch/arm64/kernel/entry-common.c:358
       el1h_64_sync_handler+0x5c/0x98 arch/arm64/kernel/entry-common.c:409
       el1h_64_sync+0x78/0x7c arch/arm64/kernel/entry.S:579
       do_strncpy_from_user lib/strncpy_from_user.c:41 [inline]
       strncpy_from_user+0x240/0x580 lib/strncpy_from_user.c:139
       getname_flags+0x104/0x480 fs/namei.c:149
       getname+0x28/0x38 fs/namei.c:217
       do_sys_openat2+0xd4/0x3d8 fs/open.c:1205
       do_sys_open fs/open.c:1227 [inline]
       __do_sys_openat fs/open.c:1243 [inline]
       __se_sys_openat fs/open.c:1238 [inline]
       __arm64_sys_openat+0x1f0/0x240 fs/open.c:1238
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
       do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
       el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
       el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
       el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

-> #1 (&mm->mmap_lock){++++}-{3:3}:
       __might_fault+0xc8/0x128 mm/memory.c:5324
       filldir64+0x2bc/0x9e4 fs/readdir.c:335
       dir_emit_dot include/linux/fs.h:3605 [inline]
       dir_emit_dots include/linux/fs.h:3616 [inline]
       exfat_iterate+0x25c/0x27a0 fs/exfat/dir.c:232
       iterate_dir+0x1f4/0x4e4
       __do_sys_getdents64 fs/readdir.c:369 [inline]
       __se_sys_getdents64 fs/readdir.c:354 [inline]
       __arm64_sys_getdents64+0x1c4/0x4c4 fs/readdir.c:354
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
       do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
       el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
       el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
       el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

-> #0 (&sbi->s_lock){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain kernel/locking/lockdep.c:3787 [inline]
       __lock_acquire+0x32cc/0x7620 kernel/locking/lockdep.c:5011
       lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
       __mutex_lock_common+0x194/0x2154 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0xa4/0xf8 kernel/locking/mutex.c:743
       exfat_get_block+0x16c/0x1b40 fs/exfat/inode.c:303
       do_mpage_readpage+0x6f8/0x1c68 fs/mpage.c:231
       mpage_readahead+0x35c/0x844 fs/mpage.c:389
       exfat_readahead+0x28/0x38 fs/exfat/inode.c:366
       read_pages+0x13c/0x420 mm/readahead.c:130
       page_cache_ra_unbounded+0x534/0x654 mm/readahead.c:239
       do_page_cache_ra mm/readahead.c:269 [inline]
       ondemand_readahead+0x62c/0xd0c mm/readahead.c:552
       page_cache_sync_ra+0x130/0x180 mm/readahead.c:580
       page_cache_sync_readahead include/linux/pagemap.h:833 [inline]
       filemap_get_pages mm/filemap.c:2551 [inline]
       filemap_read+0x52c/0x1bd4 mm/filemap.c:2634
       generic_file_read_iter+0xa0/0x3c4 mm/filemap.c:2785
       call_read_iter include/linux/fs.h:2097 [inline]
       aio_read+0x318/0x468 fs/aio.c:1543
       io_submit_one+0x838/0x161c fs/aio.c:2002
       __do_sys_io_submit fs/aio.c:2061 [inline]
       __se_sys_io_submit fs/aio.c:2031 [inline]
       __arm64_sys_io_submit+0x26c/0x3ec fs/aio.c:2031
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
       do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
       el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
       el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
       el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

other info that might help us debug this:

Chain exists of:
  &sbi->s_lock --> &mm->mmap_lock --> mapping.invalidate_lock#3

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(mapping.invalidate_lock#3);
                               lock(&mm->mmap_lock);
                               lock(mapping.invalidate_lock#3);
  lock(&sbi->s_lock);

 *** DEADLOCK ***

1 lock held by syz-executor401/15401:
 #0: ffff0000df0f9150 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:842 [inline]
 #0: ffff0000df0f9150 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: page_cache_ra_unbounded+0x158/0x654 mm/readahead.c:195

stack backtrace:
CPU: 1 PID: 15401 Comm: syz-executor401 Not tainted 5.15.121-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023
Call trace:
 dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 dump_stack+0x1c/0x58 lib/dump_stack.c:113
 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2011
 check_noncircular+0x2cc/0x378 kernel/locking/lockdep.c:2133
 check_prev_add kernel/locking/lockdep.c:3053 [inline]
 check_prevs_add kernel/locking/lockdep.c:3172 [inline]
 validate_chain kernel/locking/lockdep.c:3787 [inline]
 __lock_acquire+0x32cc/0x7620 kernel/locking/lockdep.c:5011
 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
 __mutex_lock_common+0x194/0x2154 kernel/locking/mutex.c:596
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_nested+0xa4/0xf8 kernel/locking/mutex.c:743
 exfat_get_block+0x16c/0x1b40 fs/exfat/inode.c:303
 do_mpage_readpage+0x6f8/0x1c68 fs/mpage.c:231
 mpage_readahead+0x35c/0x844 fs/mpage.c:389
 exfat_readahead+0x28/0x38 fs/exfat/inode.c:366
 read_pages+0x13c/0x420 mm/readahead.c:130
 page_cache_ra_unbounded+0x534/0x654 mm/readahead.c:239
 do_page_cache_ra mm/readahead.c:269 [inline]
 ondemand_readahead+0x62c/0xd0c mm/readahead.c:552
 page_cache_sync_ra+0x130/0x180 mm/readahead.c:580
 page_cache_sync_readahead include/linux/pagemap.h:833 [inline]
 filemap_get_pages mm/filemap.c:2551 [inline]
 filemap_read+0x52c/0x1bd4 mm/filemap.c:2634
 generic_file_read_iter+0xa0/0x3c4 mm/filemap.c:2785
 call_read_iter include/linux/fs.h:2097 [inline]
 aio_read+0x318/0x468 fs/aio.c:1543
 io_submit_one+0x838/0x161c fs/aio.c:2002
 __do_sys_io_submit fs/aio.c:2061 [inline]
 __se_sys_io_submit fs/aio.c:2031 [inline]
 __arm64_sys_io_submit+0x26c/0x3ec fs/aio.c:2031
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Crashes (111):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/07/24 03:45 linux-5.15.y cdd3cdb682f4 27cbe77f .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/03/27 17:59 linux-5.15.y 115472395b0a f8f96aa9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in exfat_get_block
2023/08/10 14:45 linux-5.15.y c275eaaaa342 da3c3ef8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/08/08 20:35 linux-5.15.y c275eaaaa342 9552ae77 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/08/08 16:33 linux-5.15.y 38d4ca22a528 9552ae77 .config console log report info ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/08/08 11:04 linux-5.15.y 38d4ca22a528 9552ae77 .config console log report info ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/08/05 23:46 linux-5.15.y 38d4ca22a528 4ffcc9ef .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/08/01 21:59 linux-5.15.y 09996673e313 df07ffe8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/30 21:15 linux-5.15.y 09996673e313 2a0d0f29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/30 17:50 linux-5.15.y 09996673e313 2a0d0f29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/27 13:53 linux-5.15.y 09996673e313 92476829 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/27 10:10 linux-5.15.y 09996673e313 41fe1bae .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/26 12:42 linux-5.15.y 5c6a716301d9 2a509c27 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/25 18:02 linux-5.15.y 5c6a716301d9 6756545c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/24 10:47 linux-5.15.y cdd3cdb682f4 b03242d7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/23 18:42 linux-5.15.y cdd3cdb682f4 27cbe77f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/21 17:59 linux-5.15.y d54cfc420586 abdf9bae .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/20 18:37 linux-5.15.y d54cfc420586 f49af159 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/20 00:07 linux-5.15.y d54cfc420586 4547cdf9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/17 17:48 linux-5.15.y d54cfc420586 20f8b3c2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/14 08:00 linux-5.15.y d54cfc420586 d624500f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/13 04:59 linux-5.15.y d54cfc420586 86081196 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/11 05:36 linux-5.15.y d54cfc420586 52ae002a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/11 04:34 linux-5.15.y d54cfc420586 52ae002a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/10 19:26 linux-5.15.y d54cfc420586 d47e94ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/10 16:43 linux-5.15.y d54cfc420586 d47e94ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/10 14:32 linux-5.15.y d54cfc420586 d47e94ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/07 20:37 linux-5.15.y d54cfc420586 668cb1fa .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/06 15:29 linux-5.15.y d54cfc420586 1a2f6297 .config console log report info ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/06 03:56 linux-5.15.y d54cfc420586 ba5dba36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/05 19:38 linux-5.15.y 4af60700a60c ba5dba36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/05 09:31 linux-5.15.y 4af60700a60c 80298b6f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/04 19:40 linux-5.15.y 4af60700a60c f99c2404 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/04 18:23 linux-5.15.y 4af60700a60c f99c2404 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/07/01 14:15 linux-5.15.y 4af60700a60c bfc47836 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/06/30 23:14 linux-5.15.y 4af60700a60c af3053d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/06/30 22:02 linux-5.15.y 4af60700a60c af3053d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/06/30 20:47 linux-5.15.y 4af60700a60c af3053d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/06/30 17:22 linux-5.15.y 4af60700a60c af3053d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/06/29 16:54 linux-5.15.y 4af60700a60c 134ddc02 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/06/29 00:47 linux-5.15.y 4af60700a60c ca69c785 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/06/28 20:01 linux-5.15.y 4af60700a60c ca69c785 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/06/28 18:27 linux-5.15.y 4af60700a60c ca69c785 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/06/28 16:34 linux-5.15.y 4af60700a60c 4cd5bb25 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
2023/03/10 08:29 linux-5.15.y d9b4a0c83a2d 5205ef30 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in exfat_get_block
* Struck through repros no longer work on HEAD.