ntfs3: loop1: Different NTFS' sector size (1024) and media sector size (512) ====================================================== WARNING: possible circular locking dependency detected 6.1.94-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/6920 is trying to acquire lock: ffff8880282b8158 (&mm->mmap_lock){++++}-{3:3}, at: __might_fault+0xa1/0x110 mm/memory.c:5835 but task is already holding lock: ffff8880514581b0 (&ni->file.run_lock#3){++++}-{3:3}, at: ni_fiemap+0x36f/0x1230 fs/ntfs3/frecord.c:1962 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ni->file.run_lock#3){++++}-{3:3}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 down_read+0xad/0xa30 kernel/locking/rwsem.c:1520 attr_data_get_block+0x276/0x2520 fs/ntfs3/attrib.c:903 ntfs_extend_initialized_size+0x31c/0x890 fs/ntfs3/file.c:125 ntfs_file_mmap+0x5a4/0x7e0 fs/ntfs3/file.c:403 call_mmap include/linux/fs.h:2270 [inline] mmap_region+0xf96/0x1fa0 mm/mmap.c:2763 do_mmap+0x8c5/0xf60 mm/mmap.c:1425 vm_mmap_pgoff+0x1ca/0x2d0 mm/util.c:520 ksys_mmap_pgoff+0x4f5/0x6d0 mm/mmap.c:1471 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&mm->mmap_lock){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __might_fault+0xbd/0x110 mm/memory.c:5835 _copy_to_user+0x26/0x130 lib/usercopy.c:36 copy_to_user include/linux/uaccess.h:169 [inline] fiemap_fill_next_extent+0x231/0x410 fs/ioctl.c:144 ni_fiemap+0xa5a/0x1230 fs/ntfs3/frecord.c:2066 ntfs_fiemap+0x12e/0x170 fs/ntfs3/file.c:1247 ioctl_fiemap fs/ioctl.c:219 [inline] do_vfs_ioctl+0x18e9/0x2a90 fs/ioctl.c:810 __do_sys_ioctl fs/ioctl.c:868 [inline] __se_sys_ioctl+0x81/0x160 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ni->file.run_lock#3); lock(&mm->mmap_lock); lock(&ni->file.run_lock#3); lock(&mm->mmap_lock); *** DEADLOCK *** 2 locks held by syz-executor.1/6920: #0: ffff888051458100 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1099 [inline] #0: ffff888051458100 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_fiemap+0xfb/0x170 fs/ntfs3/file.c:1245 #1: ffff8880514581b0 (&ni->file.run_lock#3){++++}-{3:3}, at: ni_fiemap+0x36f/0x1230 fs/ntfs3/frecord.c:1962 stack backtrace: CPU: 0 PID: 6920 Comm: syz-executor.1 Not tainted 6.1.94-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+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125