====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc4-syzkaller-00148-g50736169ecc8 #0 Not tainted ------------------------------------------------------ syz-executor.4/13861 is trying to acquire lock: ffff888059d74040 (mapping.invalidate_lock#15){++++}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:846 [inline] ffff888059d74040 (mapping.invalidate_lock#15){++++}-{3:3}, at: filemap_fault+0x275/0x2610 mm/filemap.c:3301 but task is already holding lock: ffff888015474d98 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] ffff888015474d98 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5715 [inline] ffff888015474d98 (&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+0x2f2/0xc10 fs/ntfs3/frecord.c:1948 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->ni_lock/4){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 ni_lock fs/ntfs3/ntfs_fs.h:1123 [inline] ntfs_fallocate+0xcc9/0x11c0 fs/ntfs3/file.c:556 vfs_fallocate+0x4b8/0xfb0 fs/open.c:330 ksys_fallocate fs/open.c:353 [inline] __do_sys_fallocate fs/open.c:361 [inline] __se_sys_fallocate fs/open.c:359 [inline] __x64_sys_fallocate+0xd5/0x140 fs/open.c:359 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 -> #0 (mapping.invalidate_lock#15){++++}-{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: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 mm/memory.c:5380 [inline] __handle_mm_fault+0x3a1e/0x5410 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 rep_movs_alternative+0x30/0x70 arch/x86/lib/copy_user_64.S:50 copy_user_generic arch/x86/include/asm/uaccess_64.h:110 [inline] raw_copy_from_user arch/x86/include/asm/uaccess_64.h:125 [inline] _copy_from_user+0xc6/0xf0 lib/usercopy.c:28 copy_from_user include/linux/uaccess.h:183 [inline] copy_msghdr_from_user+0x99/0x160 net/socket.c:2515 recvmsg_copy_msghdr net/socket.c:2770 [inline] ___sys_recvmsg+0xdc/0x1a0 net/socket.c:2842 do_recvmmsg+0x2ba/0x750 net/socket.c:2940 __sys_recvmmsg net/socket.c:3019 [inline] __do_sys_recvmmsg net/socket.c:3042 [inline] __se_sys_recvmmsg net/socket.c:3035 [inline] __x64_sys_recvmmsg+0x239/0x290 net/socket.c:3035 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#15 --> &ni->ni_lock/4 --> &mm->mmap_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(&mm->mmap_lock); lock(&ni->ni_lock/4); lock(&mm->mmap_lock); rlock(mapping.invalidate_lock#15); *** DEADLOCK *** 1 lock held by syz-executor.4/13861: #0: ffff888015474d98 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] #0: ffff888015474d98 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5715 [inline] #0: ffff888015474d98 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x35/0x6a0 mm/memory.c:5775 stack backtrace: CPU: 0 PID: 13861 Comm: syz-executor.4 Not tainted 6.10.0-rc4-syzkaller-00148-g50736169ecc8 #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+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: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 mm/memory.c:5380 [inline] __handle_mm_fault+0x3a1e/0x5410 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:rep_movs_alternative+0x30/0x70 arch/x86/lib/copy_user_64.S:57 Code: f9 40 73 40 83 f9 08 73 21 85 c9 74 0f 8a 06 88 07 48 ff c7 48 ff c6 48 ff c9 75 f1 c3 cc cc cc cc 66 0f 1f 84 00 00 00 00 00 <48> 8b 06 48 89 07 48 83 c6 08 48 83 c7 08 83 e9 08 74 df 83 f9 08 RSP: 0018:ffffc90003707a30 EFLAGS: 00050206 RAX: 0000000000000001 RBX: 0000000020008000 RCX: 0000000000000038 RDX: fffff520006e0f58 RSI: 0000000020008000 RDI: ffffc90003707a88 RBP: 0000000000000038 R08: 0000000000000001 R09: fffff520006e0f57 R10: ffffc90003707abf R11: 0000000000000000 R12: 0000000020008038 R13: ffffc90003707a88 R14: 0000000000000000 R15: ffffc90003707a88 copy_user_generic arch/x86/include/asm/uaccess_64.h:110 [inline] raw_copy_from_user arch/x86/include/asm/uaccess_64.h:125 [inline] _copy_from_user+0xc6/0xf0 lib/usercopy.c:28 copy_from_user include/linux/uaccess.h:183 [inline] copy_msghdr_from_user+0x99/0x160 net/socket.c:2515 recvmsg_copy_msghdr net/socket.c:2770 [inline] ___sys_recvmsg+0xdc/0x1a0 net/socket.c:2842 do_recvmmsg+0x2ba/0x750 net/socket.c:2940 __sys_recvmmsg net/socket.c:3019 [inline] __do_sys_recvmmsg net/socket.c:3042 [inline] __se_sys_recvmmsg net/socket.c:3035 [inline] __x64_sys_recvmmsg+0x239/0x290 net/socket.c:3035 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:0x7f774c67cf29 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:00007f774d45b0c8 EFLAGS: 00000246 ORIG_RAX: 000000000000012b RAX: ffffffffffffffda RBX: 00007f774c7b3f80 RCX: 00007f774c67cf29 RDX: 0400000000000284 RSI: 0000000020000040 RDI: 0000000000000007 RBP: 00007f774c6ec074 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000002b R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f774c7b3f80 R15: 00007ffdd2664a98 ---------------- Code disassembly (best guess): 0: f9 stc 1: 40 73 40 rex jae 0x44 4: 83 f9 08 cmp $0x8,%ecx 7: 73 21 jae 0x2a 9: 85 c9 test %ecx,%ecx b: 74 0f je 0x1c d: 8a 06 mov (%rsi),%al f: 88 07 mov %al,(%rdi) 11: 48 ff c7 inc %rdi 14: 48 ff c6 inc %rsi 17: 48 ff c9 dec %rcx 1a: 75 f1 jne 0xd 1c: c3 ret 1d: cc int3 1e: cc int3 1f: cc int3 20: cc int3 21: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1) 28: 00 00 * 2a: 48 8b 06 mov (%rsi),%rax <-- trapping instruction 2d: 48 89 07 mov %rax,(%rdi) 30: 48 83 c6 08 add $0x8,%rsi 34: 48 83 c7 08 add $0x8,%rdi 38: 83 e9 08 sub $0x8,%ecx 3b: 74 df je 0x1c 3d: 83 f9 08 cmp $0x8,%ecx