====================================================== WARNING: possible circular locking dependency detected 6.8.0-syzkaller-06619-ge5e038b7ae9d #0 Not tainted ------------------------------------------------------ syz-executor250/5172 is trying to acquire lock: ffff88802f49d220 (&ni->ni_lock#2/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1121 [inline] ffff88802f49d220 (&ni->ni_lock#2/4){+.+.}-{3:3}, at: attr_data_get_block+0x30b/0x1b70 fs/ntfs3/attrib.c:914 but task is already holding lock: ffff88801ac073a0 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:124 [inline] ffff88801ac073a0 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x160/0x3c0 mm/util.c:571 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&mm->mmap_lock){++++}-{3:3}: __might_fault mm/memory.c:6080 [inline] __might_fault+0x11b/0x190 mm/memory.c:6073 _copy_to_user+0x2b/0xc0 lib/usercopy.c:36 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:1206 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x404/0x1ac0 fs/ioctl.c:838 __do_sys_ioctl fs/ioctl.c:902 [inline] __se_sys_ioctl fs/ioctl.c:890 [inline] __x64_sys_ioctl+0x116/0x220 fs/ioctl.c:890 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 -> #0 (&ni->ni_lock#2/4){+.+.}-{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/0x540 kernel/locking/lockdep.c:5719 __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:1121 [inline] attr_data_get_block+0x30b/0x1b70 fs/ntfs3/attrib.c:914 ntfs_file_mmap+0x5a1/0x7e0 fs/ntfs3/file.c:294 call_mmap include/linux/fs.h:2113 [inline] mmap_region+0x747/0x2aa0 mm/mmap.c:2829 do_mmap+0x8ae/0xf10 mm/mmap.c:1387 vm_mmap_pgoff+0x1ab/0x3c0 mm/util.c:573 ksys_mmap_pgoff+0x425/0x5b0 mm/mmap.c:1433 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:79 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:79 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&mm->mmap_lock); lock(&ni->ni_lock#2/4); lock(&mm->mmap_lock); lock(&ni->ni_lock#2/4); *** DEADLOCK *** 1 lock held by syz-executor250/5172: #0: ffff88801ac073a0 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:124 [inline] #0: ffff88801ac073a0 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x160/0x3c0 mm/util.c:571 stack backtrace: CPU: 2 PID: 5172 Comm: syz-executor250 Not tainted 6.8.0-syzkaller-06619-ge5e038b7ae9d #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/0x540 kernel/locking/lockdep.c:5719 __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:1121 [inline] attr_data_get_block+0x30b/0x1b70 fs/ntfs3/attrib.c:914 ntfs_file_mmap+0x5a1/0x7e0 fs/ntfs3/file.c:294 call_mmap include/linux/fs.h:2113 [inline] mmap_region+0x747/0x2aa0 mm/mmap.c:2829 do_mmap+0x8ae/0xf10 mm/mmap.c:1387 vm_mmap_pgoff+0x1ab/0x3c0 mm/util.c:573 ksys_mmap_pgoff+0x425/0x5b0 mm/mmap.c:1433 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:79 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:79 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 RIP: 0033:0x7f88303a8b79 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 17 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:00007ffe9a6160f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007f88303a8b79 RDX: 0000000000800006 RSI: 000000000000a000 RDI: 0000000020001000 RBP: 00007f88303f105e R08: 0000000000000006 R09: 0000000000000000 R10: 0000000000000011 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffe9a6162d8 R14: 0000000000000001 R15: 0000000000000001