exFAT-fs (loop2): failed to load upcase table (idx : 0x00010000, chksum : 0x3b8a50d3, utbl_chksum : 0xe619d30d) ====================================================== WARNING: possible circular locking dependency detected 5.15.104-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.2/10977 is trying to acquire lock: ffff8880390ad250 (mapping.invalidate_lock#9){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:842 [inline] ffff8880390ad250 (mapping.invalidate_lock#9){.+.+}-{3:3}, at: filemap_fault+0x708/0x1470 mm/filemap.c:3072 but task is already holding lock: ffff8880768ef828 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] ffff8880768ef828 (&mm->mmap_lock#2){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1338 [inline] ffff8880768ef828 (&mm->mmap_lock#2){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1485 [inline] ffff8880768ef828 (&mm->mmap_lock#2){++++}-{3:3}, at: exc_page_fault+0x181/0x740 arch/x86/mm/fault.c:1541 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&mm->mmap_lock#2){++++}-{3:3}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622 down_read+0x3b/0x50 kernel/locking/rwsem.c:1488 mmap_read_lock+0x1c/0x50 include/linux/mmap_lock.h:117 do_user_addr_fault arch/x86/mm/fault.c:1348 [inline] handle_page_fault arch/x86/mm/fault.c:1485 [inline] exc_page_fault+0x5ce/0x740 arch/x86/mm/fault.c:1541 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 user_access_begin arch/x86/include/asm/uaccess.h:574 [inline] filldir+0x32b/0x720 fs/readdir.c:249 dir_emit_dot include/linux/fs.h:3605 [inline] dir_emit_dots include/linux/fs.h:3616 [inline] exfat_iterate+0x2ef/0x3290 fs/exfat/dir.c:232 iterate_dir+0x224/0x570 __do_sys_getdents fs/readdir.c:286 [inline] __se_sys_getdents+0x1e8/0x4c0 fs/readdir.c:271 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb -> #1 (&sbi->s_lock#2){+.+.}-{3:3}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 exfat_get_block+0x1ca/0x22c0 fs/exfat/inode.c:303 do_mpage_readpage+0x6c8/0x1f70 fs/mpage.c:231 mpage_readahead+0x427/0x9b0 fs/mpage.c:389 read_pages+0x159/0x8e0 mm/readahead.c:130 page_cache_ra_unbounded+0x7b0/0x930 mm/readahead.c:239 page_cache_sync_readahead include/linux/pagemap.h:833 [inline] filemap_get_pages mm/filemap.c:2551 [inline] filemap_read+0x71c/0x2980 mm/filemap.c:2634 __kernel_read+0x5ac/0xa60 fs/read_write.c:443 integrity_kernel_read+0xac/0xf0 security/integrity/iint.c:199 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:485 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:516 [inline] ima_calc_file_hash+0xa5d/0x1c00 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x293/0x530 security/integrity/ima/ima_api.c:254 process_measurement+0x1038/0x1d60 security/integrity/ima/ima_main.c:337 ima_file_check+0xf3/0x180 security/integrity/ima/ima_main.c:519 do_open fs/namei.c:3540 [inline] path_openat+0x2745/0x2f20 fs/namei.c:3672 do_filp_open+0x21c/0x460 fs/namei.c:3699 do_sys_openat2+0x13b/0x500 fs/open.c:1211 do_sys_open fs/open.c:1227 [inline] __do_sys_open fs/open.c:1235 [inline] __se_sys_open fs/open.c:1231 [inline] __x64_sys_open+0x221/0x270 fs/open.c:1231 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb -> #0 (mapping.invalidate_lock#9){.+.+}-{3:3}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1646/0x58b0 kernel/locking/lockdep.c:3787 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5011 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622 down_read+0x3b/0x50 kernel/locking/rwsem.c:1488 filemap_invalidate_lock_shared include/linux/fs.h:842 [inline] filemap_fault+0x708/0x1470 mm/filemap.c:3072 __do_fault+0x139/0x340 mm/memory.c:3871 do_read_fault mm/memory.c:4207 [inline] do_fault mm/memory.c:4335 [inline] handle_pte_fault mm/memory.c:4594 [inline] __handle_mm_fault mm/memory.c:4729 [inline] handle_mm_fault+0x376f/0x5950 mm/memory.c:4827 do_user_addr_fault arch/x86/mm/fault.c:1397 [inline] handle_page_fault arch/x86/mm/fault.c:1485 [inline] exc_page_fault+0x271/0x740 arch/x86/mm/fault.c:1541 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 strncpy_from_user+0x170/0x370 lib/strncpy_from_user.c:139 getname_flags+0xf5/0x4e0 fs/namei.c:149 do_sys_openat2+0xd2/0x500 fs/open.c:1205 do_sys_open fs/open.c:1227 [inline] __do_sys_creat fs/open.c:1301 [inline] __se_sys_creat fs/open.c:1295 [inline] __x64_sys_creat+0x11f/0x160 fs/open.c:1295 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb other info that might help us debug this: Chain exists of: mapping.invalidate_lock#9 --> &sbi->s_lock#2 --> &mm->mmap_lock#2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&mm->mmap_lock#2); lock(&sbi->s_lock#2); lock(&mm->mmap_lock#2); lock(mapping.invalidate_lock#9); *** DEADLOCK *** 1 lock held by syz-executor.2/10977: #0: ffff8880768ef828 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff8880768ef828 (&mm->mmap_lock#2){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1338 [inline] #0: ffff8880768ef828 (&mm->mmap_lock#2){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1485 [inline] #0: ffff8880768ef828 (&mm->mmap_lock#2){++++}-{3:3}, at: exc_page_fault+0x181/0x740 arch/x86/mm/fault.c:1541 stack backtrace: CPU: 0 PID: 10977 Comm: syz-executor.2 Not tainted 5.15.104-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/17/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2f8/0x3b0 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+0x1646/0x58b0 kernel/locking/lockdep.c:3787 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5011 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622 down_read+0x3b/0x50 kernel/locking/rwsem.c:1488 filemap_invalidate_lock_shared include/linux/fs.h:842 [inline] filemap_fault+0x708/0x1470 mm/filemap.c:3072 __do_fault+0x139/0x340 mm/memory.c:3871 do_read_fault mm/memory.c:4207 [inline] do_fault mm/memory.c:4335 [inline] handle_pte_fault mm/memory.c:4594 [inline] __handle_mm_fault mm/memory.c:4729 [inline] handle_mm_fault+0x376f/0x5950 mm/memory.c:4827 do_user_addr_fault arch/x86/mm/fault.c:1397 [inline] handle_page_fault arch/x86/mm/fault.c:1485 [inline] exc_page_fault+0x271/0x740 arch/x86/mm/fault.c:1541 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 RIP: 0010:do_strncpy_from_user lib/strncpy_from_user.c:41 [inline] RIP: 0010:strncpy_from_user+0x170/0x370 lib/strncpy_from_user.c:139 Code: 4c 89 ee e8 a2 cf 58 fd 49 83 fd 07 0f 86 a2 00 00 00 4c 89 7c 24 08 48 c7 44 24 10 f8 ff ff ff 45 31 e4 4c 89 f5 48 8b 04 24 <4e> 8b 3c 20 48 b8 ff fe fe fe fe fe fe fe 49 8d 1c 07 4d 89 fe 49 RSP: 0018:ffffc9000485fcb8 EFLAGS: 00050246 RAX: 0000000020000000 RBX: 00007ffffffff000 RCX: ffff888072919d00 RDX: ffffc9000efb2000 RSI: 0000000000000fe0 RDI: 0000000000000007 RBP: ffff88801e9a5520 R08: ffffffff8426ec1e R09: 0000000000001000 R10: ffff888011dc6500 R11: dffffc0000000001 R12: 0000000000000000 R13: 0000000000000fe0 R14: ffff88801e9a5520 R15: 0000000000000fe0 getname_flags+0xf5/0x4e0 fs/namei.c:149 do_sys_openat2+0xd2/0x500 fs/open.c:1205 do_sys_open fs/open.c:1227 [inline] __do_sys_creat fs/open.c:1301 [inline] __se_sys_creat fs/open.c:1295 [inline] __x64_sys_creat+0x11f/0x160 fs/open.c:1295 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fcd71fca0f9 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:00007fcd7053c168 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007fcd720e9f80 RCX: 00007fcd71fca0f9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000000 RBP: 00007fcd72025b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd390db51f R14: 00007fcd7053c300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: 4c 89 ee mov %r13,%rsi 3: e8 a2 cf 58 fd callq 0xfd58cfaa 8: 49 83 fd 07 cmp $0x7,%r13 c: 0f 86 a2 00 00 00 jbe 0xb4 12: 4c 89 7c 24 08 mov %r15,0x8(%rsp) 17: 48 c7 44 24 10 f8 ff movq $0xfffffffffffffff8,0x10(%rsp) 1e: ff ff 20: 45 31 e4 xor %r12d,%r12d 23: 4c 89 f5 mov %r14,%rbp 26: 48 8b 04 24 mov (%rsp),%rax * 2a: 4e 8b 3c 20 mov (%rax,%r12,1),%r15 <-- trapping instruction 2e: 48 b8 ff fe fe fe fe movabs $0xfefefefefefefeff,%rax 35: fe fe fe 38: 49 8d 1c 07 lea (%r15,%rax,1),%rbx 3c: 4d 89 fe mov %r15,%r14 3f: 49 rex.WB