====================================================== WARNING: possible circular locking dependency detected 6.11.0-rc7-syzkaller-g5f5673607153 #0 Not tainted ------------------------------------------------------ syz.4.155/7381 is trying to acquire lock: ffff0000d688b988 ( &mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock_killable+0x28/0x338 include/linux/mmap_lock.h:153 but task is already holding lock: ffff0000f5e77918 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: inode_trylock include/linux/fs.h:820 [inline] ffff0000f5e77918 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: ntfs_file_write_iter+0x1cc/0x610 fs/ntfs3/file.c:1166 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}: down_write+0x50/0xc0 kernel/locking/rwsem.c:1579 inode_lock include/linux/fs.h:800 [inline] ntfs_file_mmap+0x48c/0x6b8 fs/ntfs3/file.c:368 call_mmap include/linux/fs.h:2130 [inline] mmap_region+0xbb8/0x17d8 mm/mmap.c:2957 do_mmap+0x7e0/0xe00 mm/mmap.c:1468 vm_mmap_pgoff+0x1a0/0x38c mm/util.c:588 ksys_mmap_pgoff+0x3a4/0x5c8 mm/mmap.c:1514 __do_sys_mmap arch/arm64/kernel/sys.c:28 [inline] __se_sys_mmap arch/arm64/kernel/sys.c:21 [inline] __arm64_sys_mmap+0xf8/0x110 arch/arm64/kernel/sys.c:21 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 -> #0 (&mm->mmap_lock){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3133 [inline] check_prevs_add kernel/locking/lockdep.c:3252 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x33d8/0x779c kernel/locking/lockdep.c:5142 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5759 down_read_killable+0x64/0x338 kernel/locking/rwsem.c:1549 mmap_read_lock_killable+0x28/0x338 include/linux/mmap_lock.h:153 get_mmap_lock_carefully mm/memory.c:5878 [inline] lock_mm_and_find_vma+0x2a4/0x2d8 mm/memory.c:5929 do_page_fault+0x4a4/0xfa8 arch/arm64/mm/fault.c:628 do_translation_fault+0xc4/0x114 arch/arm64/mm/fault.c:743 do_mem_abort+0x74/0x200 arch/arm64/mm/fault.c:879 el1_abort+0x3c/0x5c arch/arm64/kernel/entry-common.c:432 el1h_64_sync_handler+0x60/0xac arch/arm64/kernel/entry-common.c:492 el1h_64_sync+0x64/0x68 arch/arm64/kernel/entry.S:593 __uaccess_mask_ptr arch/arm64/include/asm/uaccess.h:169 [inline] fault_in_readable+0x1bc/0x310 mm/gup.c:2244 fault_in_iov_iter_readable+0x1dc/0x22c lib/iov_iter.c:94 generic_perform_write+0x240/0x8e0 mm/filemap.c:4009 __generic_file_write_iter+0xfc/0x204 mm/filemap.c:4121 ntfs_file_write_iter+0x548/0x610 fs/ntfs3/file.c:1193 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x940/0xc80 fs/read_write.c:590 ksys_write+0x15c/0x26c fs/read_write.c:643 __do_sys_write fs/read_write.c:655 [inline] __se_sys_write fs/read_write.c:652 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:652 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sb->s_type->i_mutex_key#24); lock(&mm->mmap_lock); lock(&sb->s_type->i_mutex_key#24); rlock(&mm->mmap_lock); *** DEADLOCK *** 3 locks held by syz.4.155/7381: #0: ffff0000ce80a348 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x218/0x2a4 fs/file.c:1187 #1: ffff0000c925e420 (sb_writers#17){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2882 [inline] #1: ffff0000c925e420 (sb_writers#17){.+.+}-{0:0}, at: vfs_write+0x368/0xc80 fs/read_write.c:586 #2: ffff0000f5e77918 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: inode_trylock include/linux/fs.h:820 [inline] #2: ffff0000f5e77918 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: ntfs_file_write_iter+0x1cc/0x610 fs/ntfs3/file.c:1166 stack backtrace: CPU: 1 UID: 0 PID: 7381 Comm: syz.4.155 Not tainted 6.11.0-rc7-syzkaller-g5f5673607153 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:319 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:326 __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:119 dump_stack+0x1c/0x28 lib/dump_stack.c:128 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2059 check_noncircular+0x310/0x404 kernel/locking/lockdep.c:2186 check_prev_add kernel/locking/lockdep.c:3133 [inline] check_prevs_add kernel/locking/lockdep.c:3252 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x33d8/0x779c kernel/locking/lockdep.c:5142 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5759 down_read_killable+0x64/0x338 kernel/locking/rwsem.c:1549 mmap_read_lock_killable+0x28/0x338 include/linux/mmap_lock.h:153 get_mmap_lock_carefully mm/memory.c:5878 [inline] lock_mm_and_find_vma+0x2a4/0x2d8 mm/memory.c:5929 do_page_fault+0x4a4/0xfa8 arch/arm64/mm/fault.c:628 do_translation_fault+0xc4/0x114 arch/arm64/mm/fault.c:743 do_mem_abort+0x74/0x200 arch/arm64/mm/fault.c:879 el1_abort+0x3c/0x5c arch/arm64/kernel/entry-common.c:432 el1h_64_sync_handler+0x60/0xac arch/arm64/kernel/entry-common.c:492 el1h_64_sync+0x64/0x68 arch/arm64/kernel/entry.S:593 __uaccess_mask_ptr arch/arm64/include/asm/uaccess.h:169 [inline] fault_in_readable+0x1bc/0x310 mm/gup.c:2244 fault_in_iov_iter_readable+0x1dc/0x22c lib/iov_iter.c:94 generic_perform_write+0x240/0x8e0 mm/filemap.c:4009 __generic_file_write_iter+0xfc/0x204 mm/filemap.c:4121 ntfs_file_write_iter+0x548/0x610 fs/ntfs3/file.c:1193 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x940/0xc80 fs/read_write.c:590 ksys_write+0x15c/0x26c fs/read_write.c:643 __do_sys_write fs/read_write.c:655 [inline] __se_sys_write fs/read_write.c:652 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:652 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598