====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0 Not tainted ------------------------------------------------------ syz-executor.3/8604 is trying to acquire lock: ffff88803dfa5660 (mapping.invalidate_lock#13){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:846 [inline] ffff88803dfa5660 (mapping.invalidate_lock#13){.+.+}-{3:3}, at: filemap_fault+0x275/0x2610 mm/filemap.c:3301 but task is already holding lock: ffff88802abe3a98 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] ffff88802abe3a98 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5715 [inline] ffff88802abe3a98 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x35/0x6a0 mm/memory.c:5775 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&mm->mmap_lock){++++}-{3:3}: __might_fault mm/memory.c:6233 [inline] __might_fault+0x11b/0x190 mm/memory.c:6226 _copy_to_user+0x2b/0xc0 lib/usercopy.c:41 copy_to_user include/linux/uaccess.h:191 [inline] fiemap_fill_next_extent+0x232/0x390 fs/ioctl.c:145 ni_fiemap+0x444/0xc10 fs/ntfs3/frecord.c:2065 ntfs_fiemap+0xc9/0x120 fs/ntfs3/file.c:1215 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x404/0x1ad0 fs/ioctl.c:841 __do_sys_ioctl fs/ioctl.c:905 [inline] __se_sys_ioctl fs/ioctl.c:893 [inline] __x64_sys_ioctl+0x116/0x220 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&ni->file.run_lock#3){++++}-{3:3}: down_read+0x9a/0x330 kernel/locking/rwsem.c:1526 attr_data_get_block+0x18b/0x1b70 fs/ntfs3/attrib.c:902 ntfs_get_block_vbo+0x282/0xee0 fs/ntfs3/inode.c:599 do_mpage_readpage+0x660/0x17c0 fs/mpage.c:232 mpage_read_folio+0xa9/0x140 fs/mpage.c:399 ntfs_read_folio+0x157/0x1f0 fs/ntfs3/inode.c:737 filemap_read_folio+0xe5/0x2c0 mm/filemap.c:2355 filemap_fault+0x1446/0x2610 mm/filemap.c:3405 __do_fault+0x10a/0x490 mm/memory.c:4562 do_shared_fault mm/memory.c:4986 [inline] do_fault mm/memory.c:5060 [inline] do_pte_missing mm/memory.c:3903 [inline] handle_pte_fault mm/memory.c:5380 [inline] __handle_mm_fault+0x3afa/0x53f0 mm/memory.c:5523 handle_mm_fault+0x476/0xa00 mm/memory.c:5688 do_user_addr_fault+0x426/0xe50 arch/x86/mm/fault.c:1338 handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x5c/0xc0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #0 (mapping.invalidate_lock#13){.+.+}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 down_read+0x9a/0x330 kernel/locking/rwsem.c:1526 filemap_invalidate_lock_shared include/linux/fs.h:846 [inline] filemap_fault+0x275/0x2610 mm/filemap.c:3301 __do_fault+0x10a/0x490 mm/memory.c:4562 do_read_fault mm/memory.c:4926 [inline] do_fault mm/memory.c:5056 [inline] do_pte_missing mm/memory.c:3903 [inline] handle_pte_fault mm/memory.c:5380 [inline] __handle_mm_fault+0x39e2/0x53f0 mm/memory.c:5523 handle_mm_fault+0x476/0xa00 mm/memory.c:5688 do_user_addr_fault+0x2e5/0xe50 arch/x86/mm/fault.c:1389 handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x5c/0xc0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 fault_in_readable+0x106/0x200 mm/gup.c:2341 fault_in_iov_iter_readable+0x101/0x2c0 lib/iov_iter.c:94 generic_perform_write+0x1cc/0x620 mm/filemap.c:4005 __generic_file_write_iter+0x1d4/0x240 mm/filemap.c:4106 ntfs_file_write_iter+0xf8a/0x2050 fs/ntfs3/file.c:1129 do_iter_readv_writev+0x504/0x780 fs/read_write.c:741 vfs_writev+0x36f/0xde0 fs/read_write.c:971 do_pwritev+0x1b2/0x260 fs/read_write.c:1072 __do_sys_pwritev2 fs/read_write.c:1131 [inline] __se_sys_pwritev2 fs/read_write.c:1122 [inline] __x64_sys_pwritev2+0xef/0x160 fs/read_write.c:1122 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: mapping.invalidate_lock#13 --> &ni->file.run_lock#3 --> &mm->mmap_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(&mm->mmap_lock); lock(&ni->file.run_lock#3); lock(&mm->mmap_lock); rlock(mapping.invalidate_lock#13); *** DEADLOCK *** 3 locks held by syz-executor.3/8604: #0: ffff88802af4c420 (sb_writers#33){.+.+}-{0:0}, at: do_pwritev+0x1b2/0x260 fs/read_write.c:1072 #1: ffff88803246a120 (&sb->s_type->i_mutex_key#39){+.+.}-{3:3}, at: inode_trylock include/linux/fs.h:811 [inline] #1: ffff88803246a120 (&sb->s_type->i_mutex_key#39){+.+.}-{3:3}, at: ntfs_file_write_iter+0x2db/0x2050 fs/ntfs3/file.c:1102 #2: ffff88802abe3a98 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] #2: ffff88802abe3a98 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5715 [inline] #2: ffff88802abe3a98 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x35/0x6a0 mm/memory.c:5775 stack backtrace: CPU: 1 PID: 8604 Comm: syz-executor.3 Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 down_read+0x9a/0x330 kernel/locking/rwsem.c:1526 filemap_invalidate_lock_shared include/linux/fs.h:846 [inline] filemap_fault+0x275/0x2610 mm/filemap.c:3301 __do_fault+0x10a/0x490 mm/memory.c:4562 do_read_fault mm/memory.c:4926 [inline] do_fault mm/memory.c:5056 [inline] do_pte_missing mm/memory.c:3903 [inline] handle_pte_fault mm/memory.c:5380 [inline] __handle_mm_fault+0x39e2/0x53f0 mm/memory.c:5523 handle_mm_fault+0x476/0xa00 mm/memory.c:5688 do_user_addr_fault+0x2e5/0xe50 arch/x86/mm/fault.c:1389 handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x5c/0xc0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0010:fault_in_readable+0x106/0x200 mm/gup.c:2341 Code: ff 0f 00 00 31 c0 4c 89 eb 48 81 e5 00 f0 ff ff 4c 39 ed 48 0f 42 e8 e8 08 98 bd ff 48 39 dd 0f 84 e4 00 00 00 e8 fa 97 bd ff <44> 8a 3b e8 f2 97 bd ff 48 81 c3 00 10 00 00 44 88 7c 24 20 48 39 RSP: 0018:ffffc90003ea77b0 EFLAGS: 00050293 RAX: 0000000000000000 RBX: 0000000020008000 RCX: ffffffff81d04d1b RDX: ffff88802e482440 RSI: ffffffff81d04d56 RDI: 0000000000000007 RBP: 0000000020009000 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000c00 R11: 0000000000000003 R12: 0000000000001000 R13: 0000000020007c00 R14: 1ffff920007d4ef6 R15: 0000000000000c00 fault_in_iov_iter_readable+0x101/0x2c0 lib/iov_iter.c:94 generic_perform_write+0x1cc/0x620 mm/filemap.c:4005 __generic_file_write_iter+0x1d4/0x240 mm/filemap.c:4106 ntfs_file_write_iter+0xf8a/0x2050 fs/ntfs3/file.c:1129 do_iter_readv_writev+0x504/0x780 fs/read_write.c:741 vfs_writev+0x36f/0xde0 fs/read_write.c:971 do_pwritev+0x1b2/0x260 fs/read_write.c:1072 __do_sys_pwritev2 fs/read_write.c:1131 [inline] __se_sys_pwritev2 fs/read_write.c:1122 [inline] __x64_sys_pwritev2+0xef/0x160 fs/read_write.c:1122 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7ff964c7cee9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ff9659cd0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 RAX: ffffffffffffffda RBX: 00007ff964dabf80 RCX: 00007ff964c7cee9 RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000006 RBP: 00007ff964cc949e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001400 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007ff964dabf80 R15: 00007ffc8ebec818 ---------------- Code disassembly (best guess): 0: ff 0f decl (%rdi) 2: 00 00 add %al,(%rax) 4: 31 c0 xor %eax,%eax 6: 4c 89 eb mov %r13,%rbx 9: 48 81 e5 00 f0 ff ff and $0xfffffffffffff000,%rbp 10: 4c 39 ed cmp %r13,%rbp 13: 48 0f 42 e8 cmovb %rax,%rbp 17: e8 08 98 bd ff call 0xffbd9824 1c: 48 39 dd cmp %rbx,%rbp 1f: 0f 84 e4 00 00 00 je 0x109 25: e8 fa 97 bd ff call 0xffbd9824 * 2a: 44 8a 3b mov (%rbx),%r15b <-- trapping instruction 2d: e8 f2 97 bd ff call 0xffbd9824 32: 48 81 c3 00 10 00 00 add $0x1000,%rbx 39: 44 88 7c 24 20 mov %r15b,0x20(%rsp) 3e: 48 rex.W 3f: 39 .byte 0x39