====================================================== WARNING: possible circular locking dependency detected 6.15.0-rc3-syzkaller-00032-ga79be02bba5c #0 Not tainted ------------------------------------------------------ syz-executor179/5319 is trying to acquire lock: ffff888044f320f8 (&sb->s_type->i_mutex_key#15){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:867 [inline] ffff888044f320f8 (&sb->s_type->i_mutex_key#15){+.+.}-{4:4}, at: ntfs_file_mmap+0x63a/0x880 fs/ntfs3/file.c:397 but task is already holding lock: ffff88801b069fe0 (&mm->mmap_lock){++++}-{4:4}, at: mmap_write_lock_killable include/linux/mmap_lock.h:146 [inline] ffff88801b069fe0 (&mm->mmap_lock){++++}-{4:4}, at: vm_mmap_pgoff+0x214/0x530 mm/util.c:577 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&mm->mmap_lock){++++}-{4:4}: lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 __might_fault+0xc6/0x120 mm/memory.c:7151 _inline_copy_to_user include/linux/uaccess.h:192 [inline] _copy_to_user+0x2c/0xb0 lib/usercopy.c:26 copy_to_user include/linux/uaccess.h:225 [inline] fiemap_fill_next_extent+0x237/0x420 fs/ioctl.c:145 ni_fiemap+0xa42/0x12a0 fs/ntfs3/frecord.c:2007 ntfs_fiemap+0x134/0x180 fs/ntfs3/file.c:1380 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x1975/0x2750 fs/ioctl.c:840 __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl+0x80/0x160 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&ni->ni_lock/5){+.+.}-{4:4}: lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 __mutex_lock_common kernel/locking/mutex.c:601 [inline] __mutex_lock+0x1a5/0x10c0 kernel/locking/mutex.c:746 ni_lock fs/ntfs3/ntfs_fs.h:1105 [inline] ntfs_truncate fs/ntfs3/file.c:522 [inline] ntfs_setattr+0x6c7/0xb90 fs/ntfs3/file.c:843 notify_change+0xbca/0xe90 fs/attr.c:552 do_truncate+0x222/0x310 fs/open.c:65 handle_truncate fs/namei.c:3501 [inline] do_open fs/namei.c:3884 [inline] path_openat+0x2e4f/0x35d0 fs/namei.c:4039 do_filp_open+0x284/0x4e0 fs/namei.c:4066 do_sys_openat2+0x12b/0x1d0 fs/open.c:1429 do_sys_open fs/open.c:1444 [inline] __do_sys_open fs/open.c:1452 [inline] __se_sys_open fs/open.c:1448 [inline] __x64_sys_open+0x226/0x280 fs/open.c:1448 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&sb->s_type->i_mutex_key#15){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3166 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain+0xa69/0x24e0 kernel/locking/lockdep.c:3909 __lock_acquire+0xad5/0xd80 kernel/locking/lockdep.c:5235 lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 down_write+0x9c/0x220 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:867 [inline] ntfs_file_mmap+0x63a/0x880 fs/ntfs3/file.c:397 call_mmap include/linux/fs.h:2243 [inline] mmap_file mm/internal.h:167 [inline] __mmap_new_file_vma mm/vma.c:2353 [inline] __mmap_new_vma mm/vma.c:2417 [inline] __mmap_region mm/vma.c:2519 [inline] mmap_region+0x241d/0x2ea0 mm/vma.c:2597 do_mmap+0xd42/0x1420 mm/mmap.c:561 vm_mmap_pgoff+0x2a2/0x530 mm/util.c:579 ksys_mmap_pgoff+0x4ee/0x720 mm/mmap.c:607 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &sb->s_type->i_mutex_key#15 --> &ni->ni_lock/5 --> &mm->mmap_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&mm->mmap_lock); lock(&ni->ni_lock/5); lock(&mm->mmap_lock); lock(&sb->s_type->i_mutex_key#15); *** DEADLOCK *** 1 lock held by syz-executor179/5319: #0: ffff88801b069fe0 (&mm->mmap_lock){++++}-{4:4}, at: mmap_write_lock_killable include/linux/mmap_lock.h:146 [inline] #0: ffff88801b069fe0 (&mm->mmap_lock){++++}-{4:4}, at: vm_mmap_pgoff+0x214/0x530 mm/util.c:577 stack backtrace: CPU: 0 UID: 0 PID: 5319 Comm: syz-executor179 Not tainted 6.15.0-rc3-syzkaller-00032-ga79be02bba5c #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_circular_bug+0x2e1/0x300 kernel/locking/lockdep.c:2079 check_noncircular+0x142/0x160 kernel/locking/lockdep.c:2211 check_prev_add kernel/locking/lockdep.c:3166 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain+0xa69/0x24e0 kernel/locking/lockdep.c:3909 __lock_acquire+0xad5/0xd80 kernel/locking/lockdep.c:5235 lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 down_write+0x9c/0x220 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:867 [inline] ntfs_file_mmap+0x63a/0x880 fs/ntfs3/file.c:397 call_mmap include/linux/fs.h:2243 [inline] mmap_file mm/internal.h:167 [inline] __mmap_new_file_vma mm/vma.c:2353 [inline] __mmap_new_vma mm/vma.c:2417 [inline] __mmap_region mm/vma.c:2519 [inline] mmap_region+0x241d/0x2ea0 mm/vma.c:2597 do_mmap+0xd42/0x1420 mm/mmap.c:561 vm_mmap_pgoff+0x2a2/0x530 mm/util.c:579 ksys_mmap_pgoff+0x4ee/0x720 mm/mmap.c:607 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9772f3cc99 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 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:00007ffd770ce9f8 EFLAGS: 00000206 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007f9772f3cc99 RDX: 0000000000000002 RSI: 0000000000b36000 RDI: 0000200000000000 RBP: 00007f9772fcf5f0 R08: 0000000000000006 R09: 0000000000000000 R10: 0000000000028011 R11: 0000000000000206 R12: 00007ffd770cea30 R13: 00007ffd770cec58 R14: 431bde82d7b634db R15: 00007f9772f8503b ntfs3(loop0): ino=0, "bus" failed to extend initialized size to 1000f4. syz-executor179[5319]: segfault at 0 ip 00007f9772f3799a sp 00007ffd770ce5d8 error 4 in syz-executor1799874464[3999a,7f9772f07000+7e000] likely on CPU 0 (core 0, socket 0) Code: fe 28 7f 27 62 e1 fe 28 7f 6f 01 62 e1 fe 28 7f 77 02 62 e1 fe 28 7f 7f 03 49 83 c0 1f 49 29 d0 48 8d 7c 17 61 e9 e6 04 00 00 <62> e1 fe 28 6f 1e 62 e1 fe 28 6f 56 01 62 b3 7d 20 3f c3 00 c5 fb ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 28 7f 27 sub %bh,0x27(%rdi) 3: 62 e1 fe 28 7f 6f 01 vmovdqu64 %ymm21,0x20(%rdi) a: 62 e1 fe 28 7f 77 02 vmovdqu64 %ymm22,0x40(%rdi) 11: 62 e1 fe 28 7f 7f 03 vmovdqu64 %ymm23,0x60(%rdi) 18: 49 83 c0 1f add $0x1f,%r8 1c: 49 29 d0 sub %rdx,%r8 1f: 48 8d 7c 17 61 lea 0x61(%rdi,%rdx,1),%rdi 24: e9 e6 04 00 00 jmp 0x50f * 29: 62 e1 fe 28 6f 1e vmovdqu64 (%rsi),%ymm19 <-- trapping instruction 2f: 62 e1 fe 28 6f 56 01 vmovdqu64 0x20(%rsi),%ymm18 36: 62 b3 7d 20 3f c3 00 vpcmpeqb %ymm19,%ymm16,%k0 3d: c5 .byte 0xc5 3e: fb sti