exFAT-fs (loop3): failed to load upcase table (idx : 0x00010000, chksum : 0xa17e92ff, utbl_chksum : 0xe619d30d) ====================================================== WARNING: possible circular locking dependency detected 6.4.0-rc6-syzkaller-00269-g1b29d271614a #0 Not tainted ------------------------------------------------------ syz-executor.3/13675 is trying to acquire lock: ffff88801f85db68 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:142 [inline] ffff88801f85db68 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault+0xb3d/0x1210 arch/x86/mm/fault.c:1391 but task is already holding lock: ffff88802b7a60e0 (&sbi->s_lock#2){+.+.}-{3:3}, at: exfat_iterate+0x111/0xb40 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}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747 exfat_get_block+0x18d/0x16e0 fs/exfat/inode.c:280 do_mpage_readpage+0x768/0x1960 fs/mpage.c:234 mpage_readahead+0x344/0x580 fs/mpage.c:382 read_pages+0x1a2/0xd40 mm/readahead.c:161 page_cache_ra_unbounded+0x477/0x5e0 mm/readahead.c:270 do_page_cache_ra mm/readahead.c:300 [inline] page_cache_ra_order+0x6ec/0xa00 mm/readahead.c:560 ondemand_readahead+0x6b3/0x1080 mm/readahead.c:682 page_cache_sync_ra+0x1c9/0x200 mm/readahead.c:709 page_cache_sync_readahead include/linux/pagemap.h:1211 [inline] filemap_get_pages+0x28d/0x1620 mm/filemap.c:2601 filemap_read+0x35e/0xc70 mm/filemap.c:2696 generic_file_read_iter+0x3ad/0x5b0 mm/filemap.c:2843 __kernel_read+0x2ca/0x830 fs/read_write.c:428 integrity_kernel_read+0x7f/0xb0 security/integrity/iint.c:192 ima_calc_file_hash_tfm+0x2b3/0x3c0 security/integrity/ima/ima_crypto.c:485 ima_calc_file_shash security/integrity/ima/ima_crypto.c:516 [inline] ima_calc_file_hash+0x195/0x4a0 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x55b/0x670 security/integrity/ima/ima_api.c:293 process_measurement+0xd2f/0x1930 security/integrity/ima/ima_main.c:341 ima_file_check+0xba/0x100 security/integrity/ima/ima_main.c:539 do_open fs/namei.c:3638 [inline] path_openat+0x15d3/0x2750 fs/namei.c:3791 do_filp_open+0x1ba/0x410 fs/namei.c:3818 do_sys_openat2+0x16d/0x4c0 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_compat_sys_openat fs/open.c:1432 [inline] __se_compat_sys_openat fs/open.c:1430 [inline] __ia32_compat_sys_openat+0x143/0x1f0 fs/open.c:1430 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 -> #1 (mapping.invalidate_lock#11){.+.+}-{3:3}: down_read+0x9c/0x480 kernel/locking/rwsem.c:1520 filemap_invalidate_lock_shared include/linux/fs.h:830 [inline] filemap_fault+0xbba/0x24c0 mm/filemap.c:3277 __do_fault+0x107/0x600 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+0x28bc/0x41c0 mm/memory.c:5089 handle_mm_fault+0x2af/0x9f0 mm/memory.c:5243 do_user_addr_fault+0x51a/0x1210 arch/x86/mm/fault.c:1440 handle_page_fault arch/x86/mm/fault.c:1534 [inline] exc_page_fault+0x98/0x170 arch/x86/mm/fault.c:1590 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 copy_user_generic arch/x86/include/asm/uaccess_64.h:112 [inline] raw_copy_from_user arch/x86/include/asm/uaccess_64.h:127 [inline] _copy_from_user+0xbc/0xf0 lib/usercopy.c:23 copy_from_user include/linux/uaccess.h:183 [inline] move_addr_to_kernel.part.0+0x31/0x110 net/socket.c:250 move_addr_to_kernel net/socket.c:248 [inline] __sys_bind+0xde/0x260 net/socket.c:1797 __do_sys_bind net/socket.c:1814 [inline] __se_sys_bind net/socket.c:1812 [inline] __ia32_sys_bind+0x72/0xb0 net/socket.c:1812 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 -> #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 kernel/locking/lockdep.c:3847 [inline] __lock_acquire+0x2fcd/0x5f30 kernel/locking/lockdep.c:5088 lock_acquire kernel/locking/lockdep.c:5705 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5670 down_read+0x9c/0x480 kernel/locking/rwsem.c:1520 mmap_read_lock include/linux/mmap_lock.h:142 [inline] do_user_addr_fault+0xb3d/0x1210 arch/x86/mm/fault.c:1391 handle_page_fault arch/x86/mm/fault.c:1534 [inline] exc_page_fault+0x98/0x170 arch/x86/mm/fault.c:1590 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 compat_filldir+0x28d/0x5f0 fs/readdir.c:504 dir_emit_dot include/linux/fs.h:3163 [inline] dir_emit_dots include/linux/fs.h:3174 [inline] exfat_iterate+0x56b/0xb40 fs/exfat/dir.c:235 iterate_dir+0x1fd/0x6f0 fs/readdir.c:67 __do_compat_sys_getdents fs/readdir.c:537 [inline] __se_compat_sys_getdents fs/readdir.c:522 [inline] __ia32_compat_sys_getdents+0x13d/0x2c0 fs/readdir.c:522 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 other info that might help us debug this: Chain exists of: &mm->mmap_lock --> mapping.invalidate_lock#11 --> &sbi->s_lock#2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sbi->s_lock#2); lock(mapping.invalidate_lock#11); lock(&sbi->s_lock#2); rlock(&mm->mmap_lock); *** DEADLOCK *** 3 locks held by syz-executor.3/13675: #0: ffff88801e7f4868 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0xe7/0x100 fs/file.c:1047 #1: ffff888058d49cb0 (&sb->s_type->i_mutex_key#39){+.+.}-{3:3}, at: iterate_dir+0x504/0x6f0 fs/readdir.c:57 #2: ffff88802b7a60e0 (&sbi->s_lock#2){+.+.}-{3:3}, at: exfat_iterate+0x111/0xb40 fs/exfat/dir.c:232 stack backtrace: CPU: 1 PID: 13675 Comm: syz-executor.3 Not tainted 6.4.0-rc6-syzkaller-00269-g1b29d271614a #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 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 kernel/locking/lockdep.c:3847 [inline] __lock_acquire+0x2fcd/0x5f30 kernel/locking/lockdep.c:5088 lock_acquire kernel/locking/lockdep.c:5705 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5670 down_read+0x9c/0x480 kernel/locking/rwsem.c:1520 mmap_read_lock include/linux/mmap_lock.h:142 [inline] do_user_addr_fault+0xb3d/0x1210 arch/x86/mm/fault.c:1391 handle_page_fault arch/x86/mm/fault.c:1534 [inline] exc_page_fault+0x98/0x170 arch/x86/mm/fault.c:1590 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0010:compat_filldir+0x28d/0x5f0 fs/readdir.c:504 Code: 69 d3 98 ff 4c 89 f6 4c 89 ff e8 1e cf 98 ff 48 83 7c 24 30 00 0f 85 48 02 00 00 e8 4d d3 98 ff 0f 01 cb 0f ae e8 8b 44 24 08 <41> 89 47 04 e8 3a d3 98 ff 4c 8b 74 24 28 8b 3c 24 41 89 3e e8 2a RSP: 0018:ffffc9000cc6fbe0 EFLAGS: 00050212 RAX: 0000000000000000 RBX: ffffc9000cc6fe78 RCX: ffffc90004241000 RDX: 0000000000040000 RSI: ffffffff81eb7393 RDI: 0000000000000006 RBP: 0000000000000001 R08: 0000000000000006 R09: 0000000020000440 R10: 0000000020000450 R11: 0000000000000002 R12: 0000000000000010 R13: ffffffff8a662d40 R14: 0000000020000450 R15: 0000000020000440 dir_emit_dot include/linux/fs.h:3163 [inline] dir_emit_dots include/linux/fs.h:3174 [inline] exfat_iterate+0x56b/0xb40 fs/exfat/dir.c:235 iterate_dir+0x1fd/0x6f0 fs/readdir.c:67 __do_compat_sys_getdents fs/readdir.c:537 [inline] __se_compat_sys_getdents fs/readdir.c:522 [inline] __ia32_compat_sys_getdents+0x13d/0x2c0 fs/readdir.c:522 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 RIP: 0023:0xf7f67579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f7f625cc EFLAGS: 00000296 ORIG_RAX: 000000000000008d RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000020000440 RDX: 00000000000000ea RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: d3 98 ff 4c 89 f6 rcrl %cl,-0x976b301(%rax) 6: 4c 89 ff mov %r15,%rdi 9: e8 1e cf 98 ff callq 0xff98cf2c e: 48 83 7c 24 30 00 cmpq $0x0,0x30(%rsp) 14: 0f 85 48 02 00 00 jne 0x262 1a: e8 4d d3 98 ff callq 0xff98d36c 1f: 0f 01 cb stac 22: 0f ae e8 lfence 25: 8b 44 24 08 mov 0x8(%rsp),%eax * 29: 41 89 47 04 mov %eax,0x4(%r15) <-- trapping instruction 2d: e8 3a d3 98 ff callq 0xff98d36c 32: 4c 8b 74 24 28 mov 0x28(%rsp),%r14 37: 8b 3c 24 mov (%rsp),%edi 3a: 41 89 3e mov %edi,(%r14) 3d: e8 .byte 0xe8 3e: 2a .byte 0x2a