exFAT-fs (loop3): failed to load upcase table (idx : 0x00010000, chksum : 0xe3157ffd, utbl_chksum : 0xe619d30d) ====================================================== WARNING: possible circular locking dependency detected 6.4.0-syzkaller-01224-g1ef6663a587b #0 Not tainted ------------------------------------------------------ syz-executor.3/24558 is trying to acquire lock: ffff88807efbd268 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:142 [inline] ffff88807efbd268 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1391 [inline] ffff88807efbd268 (&mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1534 [inline] ffff88807efbd268 (&mm->mmap_lock){++++}-{3:3}, at: exc_page_fault+0x6a8/0x910 arch/x86/mm/fault.c:1590 but task is already holding lock: ffff88803ca6a0e0 (&sbi->s_lock#2){+.+.}-{3:3}, at: exfat_iterate+0x174/0x3380 fs/exfat/dir.c:232 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&sbi->s_lock#2){+.+.}-{3:3}: lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5705 __mutex_lock_common+0x1d8/0x2530 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x1b/0x20 kernel/locking/mutex.c:799 exfat_get_block+0x1e5/0x2050 fs/exfat/inode.c:280 block_read_full_folio+0x47b/0x1000 fs/buffer.c:2348 do_mpage_readpage+0x1ba1/0x1fa0 fs/mpage.c:325 mpage_read_folio+0x108/0x1d0 fs/mpage.c:400 filemap_read_folio+0x19d/0x7a0 mm/filemap.c:2427 filemap_update_page mm/filemap.c:2511 [inline] filemap_get_pages+0x15a5/0x20c0 mm/filemap.c:2625 filemap_splice_read+0x4ce/0xcd0 mm/filemap.c:2930 splice_direct_to_actor+0x2a8/0x9a0 fs/splice.c:961 do_splice_direct+0x286/0x3d0 fs/splice.c:1070 do_sendfile+0x623/0x1070 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1322 [inline] __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1308 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #1 (mapping.invalidate_lock#9){.+.+}-{3:3}: lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5705 down_read+0x47/0x2f0 kernel/locking/rwsem.c:1520 filemap_invalidate_lock_shared include/linux/fs.h:826 [inline] filemap_fault+0x647/0x1810 mm/filemap.c:3294 __do_fault+0x136/0x500 mm/memory.c:4176 do_read_fault mm/memory.c:4530 [inline] do_fault mm/memory.c:4659 [inline] do_pte_missing mm/memory.c:3647 [inline] handle_pte_fault mm/memory.c:4947 [inline] __handle_mm_fault mm/memory.c:5089 [inline] handle_mm_fault+0x41a8/0x5860 mm/memory.c:5243 do_user_addr_fault arch/x86/mm/fault.c:1440 [inline] handle_page_fault arch/x86/mm/fault.c:1534 [inline] exc_page_fault+0x7d2/0x910 arch/x86/mm/fault.c:1590 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 strncpy_from_user+0x111/0x2e0 lib/strncpy_from_user.c:139 getname_flags+0xf9/0x4e0 fs/namei.c:151 do_sys_openat2+0xd1/0x520 fs/open.c:1396 do_sys_open fs/open.c:1418 [inline] __do_sys_openat fs/open.c:1434 [inline] __se_sys_openat fs/open.c:1429 [inline] __x64_sys_openat+0x247/0x290 fs/open.c:1429 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&mm->mmap_lock){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3113 [inline] check_prevs_add kernel/locking/lockdep.c:3232 [inline] validate_chain+0x166b/0x58f0 kernel/locking/lockdep.c:3847 __lock_acquire+0x1316/0x2070 kernel/locking/lockdep.c:5088 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5705 down_read+0x47/0x2f0 kernel/locking/rwsem.c:1520 mmap_read_lock include/linux/mmap_lock.h:142 [inline] do_user_addr_fault arch/x86/mm/fault.c:1391 [inline] handle_page_fault arch/x86/mm/fault.c:1534 [inline] exc_page_fault+0x6a8/0x910 arch/x86/mm/fault.c:1590 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 filldir64+0x2a1/0x6a0 fs/readdir.c:331 dir_emit_dot include/linux/fs.h:3186 [inline] dir_emit_dots include/linux/fs.h:3197 [inline] exfat_iterate+0x2be/0x3380 fs/exfat/dir.c:235 iterate_dir+0x231/0x5a0 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0x20d/0x4f0 fs/readdir.c:354 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Chain exists of: &mm->mmap_lock --> mapping.invalidate_lock#9 --> &sbi->s_lock#2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sbi->s_lock#2); lock(mapping.invalidate_lock#9); lock(&sbi->s_lock#2); rlock(&mm->mmap_lock); *** DEADLOCK *** 3 locks held by syz-executor.3/24558: #0: ffff88802bddafc8 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x254/0x2f0 fs/file.c:1047 #1: ffff88823bcb22b0 (&sb->s_type->i_mutex_key#30){++++}-{3:3}, at: iterate_dir+0x13e/0x5a0 fs/readdir.c:57 #2: ffff88803ca6a0e0 (&sbi->s_lock#2){+.+.}-{3:3}, at: exfat_iterate+0x174/0x3380 fs/exfat/dir.c:232 stack backtrace: CPU: 0 PID: 24558 Comm: syz-executor.3 Not tainted 6.4.0-syzkaller-01224-g1ef6663a587b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2fe/0x3b0 kernel/locking/lockdep.c:2188 check_prev_add kernel/locking/lockdep.c:3113 [inline] check_prevs_add kernel/locking/lockdep.c:3232 [inline] validate_chain+0x166b/0x58f0 kernel/locking/lockdep.c:3847 __lock_acquire+0x1316/0x2070 kernel/locking/lockdep.c:5088 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5705 down_read+0x47/0x2f0 kernel/locking/rwsem.c:1520 mmap_read_lock include/linux/mmap_lock.h:142 [inline] do_user_addr_fault arch/x86/mm/fault.c:1391 [inline] handle_page_fault arch/x86/mm/fault.c:1534 [inline] exc_page_fault+0x6a8/0x910 arch/x86/mm/fault.c:1590 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0010:filldir64+0x2a1/0x6a0 fs/readdir.c:335 Code: 92 ff 4c 89 f7 48 89 de e8 dc d9 92 ff 49 01 df 0f 88 5a 02 00 00 49 39 df 0f 82 51 02 00 00 0f 01 cb 0f ae e8 48 8b 44 24 60 <48> 89 43 08 48 8b 4c 24 10 48 8b 44 24 58 48 89 01 48 8b 44 24 18 RSP: 0018:ffffc90003bdf6c0 EFLAGS: 00050206 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff8880273e9dc0 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000018 RBP: 0000000000000000 R08: ffffffff81f8d514 R09: 0000000000000004 R10: 0000000000000003 R11: ffff8880273e9dc0 R12: ffffffff8aff0fe0 R13: 0000000000000001 R14: 0000000000000018 R15: 0000000000000018 dir_emit_dot include/linux/fs.h:3186 [inline] dir_emit_dots include/linux/fs.h:3197 [inline] exfat_iterate+0x2be/0x3380 fs/exfat/dir.c:235 iterate_dir+0x231/0x5a0 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0x20d/0x4f0 fs/readdir.c:354 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f9d2488c389 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f9d2556e168 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007f9d249abf80 RCX: 00007f9d2488c389 RDX: 0000000000000ff4 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007f9d248d7493 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc08adc09f R14: 00007f9d2556e300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: 92 xchg %eax,%edx 1: ff 4c 89 f7 decl -0x9(%rcx,%rcx,4) 5: 48 89 de mov %rbx,%rsi 8: e8 dc d9 92 ff callq 0xff92d9e9 d: 49 01 df add %rbx,%r15 10: 0f 88 5a 02 00 00 js 0x270 16: 49 39 df cmp %rbx,%r15 19: 0f 82 51 02 00 00 jb 0x270 1f: 0f 01 cb stac 22: 0f ae e8 lfence 25: 48 8b 44 24 60 mov 0x60(%rsp),%rax * 2a: 48 89 43 08 mov %rax,0x8(%rbx) <-- trapping instruction 2e: 48 8b 4c 24 10 mov 0x10(%rsp),%rcx 33: 48 8b 44 24 58 mov 0x58(%rsp),%rax 38: 48 89 01 mov %rax,(%rcx) 3b: 48 8b 44 24 18 mov 0x18(%rsp),%rax