loop3: detected capacity change from 0 to 4096 ====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc3-next-20240611-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.3/11497 is trying to acquire lock: ffff88807d9dea18 (&mm->mmap_lock){++++}-{3:3}, at: __might_fault+0xaa/0x120 mm/memory.c:6355 but task is already holding lock: ffff88805c1befd8 (&ni->file.run_lock#3){++++}-{3:3}, at: ni_fiemap+0x373/0x1230 fs/ntfs3/frecord.c:1963 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&ni->file.run_lock#3){++++}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5817 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1526 attr_data_get_block+0x2ec/0x2ff0 fs/ntfs3/attrib.c:905 ntfs_get_block_vbo+0x3e4/0xd50 fs/ntfs3/inode.c:599 __block_write_begin_int+0x50c/0x1a70 fs/buffer.c:2125 __block_write_begin fs/buffer.c:2174 [inline] block_write_begin+0x9b/0x1e0 fs/buffer.c:2233 ntfs_extend_initialized_size+0x3f5/0x7a0 fs/ntfs3/file.c:144 ntfs_extend+0x3fe/0x480 fs/ntfs3/file.c:338 ntfs_file_write_iter+0x3ea/0x770 fs/ntfs3/file.c:1121 do_iter_readv_writev+0x5a4/0x800 vfs_writev+0x395/0xbe0 fs/read_write.c:971 do_pwritev fs/read_write.c:1072 [inline] __do_sys_pwritev2 fs/read_write.c:1131 [inline] __se_sys_pwritev2+0x1ca/0x2d0 fs/read_write.c:1122 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 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5817 down_write+0x3a/0x50 kernel/locking/rwsem.c:1579 inode_lock include/linux/fs.h:795 [inline] ntfs_file_mmap+0x5d8/0x860 fs/ntfs3/file.c:302 call_mmap include/linux/fs.h:2123 [inline] mmap_region+0xe8f/0x2090 mm/mmap.c:2927 do_mmap+0x8ad/0xfa0 mm/mmap.c:1438 vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:573 ksys_mmap_pgoff+0x4f1/0x720 mm/mmap.c:1484 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 (&mm->mmap_lock){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3159 [inline] check_prevs_add kernel/locking/lockdep.c:3278 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3902 __lock_acquire+0x1359/0x2000 kernel/locking/lockdep.c:5194 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5817 __might_fault+0xc6/0x120 mm/memory.c:6355 _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:2067 ntfs_fiemap+0x132/0x180 fs/ntfs3/file.c:1212 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 other info that might help us debug this: Chain exists of: &mm->mmap_lock --> &sb->s_type->i_mutex_key#28 --> &ni->file.run_lock#3 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(&ni->file.run_lock#3); lock(&sb->s_type->i_mutex_key#28); lock(&ni->file.run_lock#3); rlock(&mm->mmap_lock); *** DEADLOCK *** 2 locks held by syz-executor.3/11497: #0: ffff88805c1bef28 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1107 [inline] #0: ffff88805c1bef28 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_fiemap+0xff/0x180 fs/ntfs3/file.c:1210 #1: ffff88805c1befd8 (&ni->file.run_lock#3){++++}-{3:3}, at: ni_fiemap+0x373/0x1230 fs/ntfs3/frecord.c:1963 stack backtrace: CPU: 1 PID: 11497 Comm: syz-executor.3 Not tainted 6.10.0-rc3-next-20240611-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:91 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:117 print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2075 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2204 check_prev_add kernel/locking/lockdep.c:3159 [inline] check_prevs_add kernel/locking/lockdep.c:3278 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3902 __lock_acquire+0x1359/0x2000 kernel/locking/lockdep.c:5194 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5817 __might_fault+0xc6/0x120 mm/memory.c:6355 _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:2067 ntfs_fiemap+0x132/0x180 fs/ntfs3/file.c:1212 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 RIP: 0033:0x7f150467cea9 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:00007f150530c0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f15047b3f80 RCX: 00007f150467cea9 RDX: 00000000200000c0 RSI: 00000000c020660b RDI: 0000000000000004 RBP: 00007f15046ebff4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f15047b3f80 R15: 00007ffd66389d58