====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc5-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/12457 is trying to acquire lock: ffff888076f14040 (mapping.invalidate_lock#7){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:846 [inline] ffff888076f14040 (mapping.invalidate_lock#7){.+.+}-{3:3}, at: filemap_fault+0x658/0x1760 mm/filemap.c:3301 but task is already holding lock: ffff88807d93cd98 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] ffff88807d93cd98 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5715 [inline] ffff88807d93cd98 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x32/0x2f0 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}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __might_fault+0xc6/0x120 mm/memory.c:6233 _copy_to_user+0x2a/0xb0 lib/usercopy.c:41 copy_to_user include/linux/uaccess.h:191 [inline] fiemap_fill_next_extent+0x235/0x410 fs/ioctl.c:145 ni_fiemap+0xa5e/0x1230 fs/ntfs3/frecord.c:2065 ntfs_fiemap+0x132/0x180 fs/ntfs3/file.c:1215 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x1c07/0x2e50 fs/ioctl.c:841 __do_sys_ioctl fs/ioctl.c:905 [inline] __se_sys_ioctl+0x81/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&ni->file.run_lock#3){++++}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1526 attr_data_get_block+0x2e3/0x2e10 fs/ntfs3/attrib.c:902 ntfs_get_block_vbo+0x3e4/0xd50 fs/ntfs3/inode.c:599 do_mpage_readpage+0x827/0x1c80 fs/mpage.c:232 mpage_readahead+0x44f/0x930 fs/mpage.c:381 read_pages+0x17e/0x840 mm/readahead.c:160 page_cache_ra_unbounded+0x188/0x7f0 mm/readahead.c:242 do_sync_mmap_readahead+0x49c/0x970 filemap_fault+0x828/0x1760 mm/filemap.c:3313 __do_fault+0x135/0x460 mm/memory.c:4556 do_read_fault mm/memory.c:4920 [inline] do_fault mm/memory.c:5050 [inline] do_pte_missing mm/memory.c:3897 [inline] handle_pte_fault+0x3d15/0x7090 mm/memory.c:5380 __handle_mm_fault mm/memory.c:5523 [inline] handle_mm_fault+0xfb0/0x19d0 mm/memory.c:5688 do_user_addr_fault arch/x86/mm/fault.c:1389 [inline] handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x2b9/0x8c0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 fault_in_readable+0x165/0x2b0 fault_in_iov_iter_readable+0x229/0x280 lib/iov_iter.c:94 generic_perform_write+0x220/0x640 mm/filemap.c:4005 ntfs_file_write_iter+0x68f/0x770 fs/ntfs3/file.c:1129 new_sync_write fs/read_write.c:497 [inline] vfs_write+0xa72/0xc90 fs/read_write.c:590 ksys_write+0x1a0/0x2c0 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (mapping.invalidate_lock#7){.+.+}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1526 filemap_invalidate_lock_shared include/linux/fs.h:846 [inline] filemap_fault+0x658/0x1760 mm/filemap.c:3301 __do_fault+0x135/0x460 mm/memory.c:4556 do_read_fault mm/memory.c:4920 [inline] do_fault mm/memory.c:5050 [inline] do_pte_missing mm/memory.c:3897 [inline] handle_pte_fault+0x3d15/0x7090 mm/memory.c:5380 __handle_mm_fault mm/memory.c:5523 [inline] handle_mm_fault+0xfb0/0x19d0 mm/memory.c:5688 do_user_addr_fault arch/x86/mm/fault.c:1389 [inline] handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x2b9/0x8c0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 fault_in_readable+0x165/0x2b0 fault_in_iov_iter_readable+0x229/0x280 lib/iov_iter.c:94 generic_perform_write+0x220/0x640 mm/filemap.c:4005 ntfs_file_write_iter+0x68f/0x770 fs/ntfs3/file.c:1129 new_sync_write fs/read_write.c:497 [inline] vfs_write+0xa72/0xc90 fs/read_write.c:590 ksys_write+0x1a0/0x2c0 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 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#7 --> &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#7); *** DEADLOCK *** 4 locks held by syz-executor.4/12457: #0: ffff888064eb85c8 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x24e/0x310 fs/file.c:1191 #1: ffff88807b7bc420 (sb_writers#25){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2854 [inline] #1: ffff88807b7bc420 (sb_writers#25){.+.+}-{0:0}, at: vfs_write+0x227/0xc90 fs/read_write.c:586 #2: ffff888076f13ea0 (&sb->s_type->i_mutex_key#33){+.+.}-{3:3}, at: inode_trylock include/linux/fs.h:811 [inline] #2: ffff888076f13ea0 (&sb->s_type->i_mutex_key#33){+.+.}-{3:3}, at: ntfs_file_write_iter+0x25a/0x770 fs/ntfs3/file.c:1102 #3: ffff88807d93cd98 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] #3: ffff88807d93cd98 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5715 [inline] #3: ffff88807d93cd98 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x32/0x2f0 mm/memory.c:5775 stack backtrace: CPU: 0 PID: 12457 Comm: syz-executor.4 Not tainted 6.10.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 check_noncircular+0x36a/0x4a0 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+0x18e0/0x5900 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1526 filemap_invalidate_lock_shared include/linux/fs.h:846 [inline] filemap_fault+0x658/0x1760 mm/filemap.c:3301 __do_fault+0x135/0x460 mm/memory.c:4556 do_read_fault mm/memory.c:4920 [inline] do_fault mm/memory.c:5050 [inline] do_pte_missing mm/memory.c:3897 [inline] handle_pte_fault+0x3d15/0x7090 mm/memory.c:5380 __handle_mm_fault mm/memory.c:5523 [inline] handle_mm_fault+0xfb0/0x19d0 mm/memory.c:5688 do_user_addr_fault arch/x86/mm/fault.c:1389 [inline] handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x2b9/0x8c0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0010:fault_in_readable+0x165/0x2b0 mm/gup.c:2341 Code: b8 ff 4c 8d b3 ff 0f 00 00 48 89 d8 4d 01 e6 49 81 e6 00 f0 ff ff 49 39 c6 72 6b e8 65 57 b8 ff 4c 39 f3 74 6e 4c 89 64 24 10 <44> 8a 23 43 0f b6 04 2f 84 c0 75 18 44 88 64 24 40 48 81 c3 00 10 RSP: 0018:ffffc90002e7f9e0 EFLAGS: 00050287 RAX: ffffffff81ddcd3b RBX: 000000002000f000 RCX: 0000000000040000 RDX: ffffc90009ef9000 RSI: 0000000000018b6a RDI: 0000000000018b6b RBP: ffffc90002e7fa98 R08: ffffffff81ddccd8 R09: ffffffff84a3aae9 R10: 0000000000000002 R11: ffff88801e588000 R12: 0000000000001000 R13: dffffc0000000000 R14: 0000000020010000 R15: 1ffff920005cff44 fault_in_iov_iter_readable+0x229/0x280 lib/iov_iter.c:94 generic_perform_write+0x220/0x640 mm/filemap.c:4005 ntfs_file_write_iter+0x68f/0x770 fs/ntfs3/file.c:1129 new_sync_write fs/read_write.c:497 [inline] vfs_write+0xa72/0xc90 fs/read_write.c:590 ksys_write+0x1a0/0x2c0 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa6f9e7d0a9 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:00007fa6fab3a0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fa6f9fb3f80 RCX: 00007fa6f9e7d0a9 RDX: 00000000175d9003 RSI: 0000000020000200 RDI: 0000000000000006 RBP: 00007fa6f9eec074 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fa6f9fb3f80 R15: 00007ffc0145efa8 ---------------- Code disassembly (best guess): 0: b8 ff 4c 8d b3 mov $0xb38d4cff,%eax 5: ff 0f decl (%rdi) 7: 00 00 add %al,(%rax) 9: 48 89 d8 mov %rbx,%rax c: 4d 01 e6 add %r12,%r14 f: 49 81 e6 00 f0 ff ff and $0xfffffffffffff000,%r14 16: 49 39 c6 cmp %rax,%r14 19: 72 6b jb 0x86 1b: e8 65 57 b8 ff call 0xffb85785 20: 4c 39 f3 cmp %r14,%rbx 23: 74 6e je 0x93 25: 4c 89 64 24 10 mov %r12,0x10(%rsp) * 2a: 44 8a 23 mov (%rbx),%r12b <-- trapping instruction 2d: 43 0f b6 04 2f movzbl (%r15,%r13,1),%eax 32: 84 c0 test %al,%al 34: 75 18 jne 0x4e 36: 44 88 64 24 40 mov %r12b,0x40(%rsp) 3b: 48 rex.W 3c: 81 .byte 0x81 3d: c3 ret 3e: 00 10 add %dl,(%rax)