====================================================== WARNING: possible circular locking dependency detected 6.1.105-syzkaller #0 Not tainted ------------------------------------------------------ syz.1.257/5546 is trying to acquire lock: ffff0000d5bfd548 (&mm->mmap_lock){++++}-{3:3}, at: __might_fault+0x9c/0x124 mm/memory.c:5834 but task is already holding lock: ffff0000f1ecc410 (&ni->file.run_lock#3){++++}-{3:3}, at: ni_fiemap+0x2c4/0xe10 fs/ntfs3/frecord.c:1962 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&ni->file.run_lock#3){++++}-{3:3}: down_read+0x64/0x308 kernel/locking/rwsem.c:1520 attr_data_get_block+0x220/0x1bdc fs/ntfs3/attrib.c:907 ntfs_get_block_vbo+0x2f4/0xd14 fs/ntfs3/inode.c:591 ntfs_get_block+0x84/0xc4 fs/ntfs3/inode.c:687 do_mpage_readpage+0x5d8/0x1748 fs/mpage.c:208 mpage_readahead+0x360/0x644 fs/mpage.c:361 ntfs_readahead+0x1a4/0x1f4 fs/ntfs3/inode.c:760 read_pages+0x168/0x6a0 mm/readahead.c:161 page_cache_ra_unbounded+0x14c/0x58c mm/readahead.c:242 do_page_cache_ra mm/readahead.c:300 [inline] page_cache_ra_order+0x850/0xa74 mm/readahead.c:564 ondemand_readahead+0x5f0/0xafc mm/readahead.c:686 page_cache_sync_ra+0x350/0x3d0 mm/readahead.c:713 page_cache_sync_readahead include/linux/pagemap.h:1248 [inline] filemap_get_pages mm/filemap.c:2636 [inline] filemap_read+0x598/0x2264 mm/filemap.c:2730 generic_file_read_iter+0xa0/0x450 mm/filemap.c:2885 ntfs_file_read_iter+0x184/0x1e0 fs/ntfs3/file.c:850 call_read_iter include/linux/fs.h:2259 [inline] generic_file_splice_read+0x1e0/0x508 fs/splice.c:308 do_splice_to fs/splice.c:803 [inline] splice_direct_to_actor+0x30c/0x9b4 fs/splice.c:875 do_splice_direct+0x20c/0x348 fs/splice.c:1002 do_sendfile+0x4c0/0xcb0 fs/read_write.c:1255 __do_sys_sendfile64 fs/read_write.c:1323 [inline] __se_sys_sendfile64 fs/read_write.c:1309 [inline] __arm64_sys_sendfile64+0x160/0x3b4 fs/read_write.c:1309 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #1 (mapping.invalidate_lock#4){++++}-{3:3}: down_read+0x64/0x308 kernel/locking/rwsem.c:1520 filemap_invalidate_lock_shared include/linux/fs.h:813 [inline] filemap_fault+0x58c/0xf7c mm/filemap.c:3191 __do_fault+0x11c/0x3d8 mm/memory.c:4261 do_read_fault mm/memory.c:4612 [inline] do_fault mm/memory.c:4741 [inline] handle_pte_fault mm/memory.c:5013 [inline] __handle_mm_fault mm/memory.c:5155 [inline] handle_mm_fault+0x1f90/0x3ef0 mm/memory.c:5276 __do_page_fault arch/arm64/mm/fault.c:499 [inline] do_page_fault+0x330/0x890 arch/arm64/mm/fault.c:583 do_translation_fault+0x94/0xc8 arch/arm64/mm/fault.c:667 do_mem_abort+0x74/0x200 arch/arm64/mm/fault.c:803 el1_abort+0x3c/0x5c arch/arm64/kernel/entry-common.c:367 el1h_64_sync_handler+0x60/0xac arch/arm64/kernel/entry-common.c:427 el1h_64_sync+0x64/0x68 arch/arm64/kernel/entry.S:580 fault_in_readable+0x370/0x5f0 mm/gup.c:1898 fault_in_iov_iter_readable+0xcc/0x22c lib/iov_iter.c:356 generic_perform_write+0x1c8/0x55c mm/filemap.c:3807 __generic_file_write_iter+0x168/0x388 mm/filemap.c:3945 ntfs_file_write_iter+0x4d4/0x580 fs/ntfs3/file.c:1163 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x610/0x91c fs/read_write.c:584 ksys_write+0x15c/0x26c fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:646 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #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 kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x3338/0x7680 kernel/locking/lockdep.c:5049 lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5662 __might_fault+0xc4/0x124 mm/memory.c:5835 _copy_to_user include/linux/uaccess.h:143 [inline] copy_to_user include/linux/uaccess.h:169 [inline] fiemap_fill_next_extent+0x1b4/0x424 fs/ioctl.c:144 ni_fiemap+0x744/0xe10 fs/ntfs3/frecord.c:2045 ntfs_fiemap+0x110/0x168 fs/ntfs3/file.c:1244 ioctl_fiemap fs/ioctl.c:219 [inline] do_vfs_ioctl+0x194c/0x26f8 fs/ioctl.c:810 __do_sys_ioctl fs/ioctl.c:868 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0xe4/0x1c8 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 other info that might help us debug this: Chain exists of: &mm->mmap_lock --> mapping.invalidate_lock#4 --> &ni->file.run_lock#3 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ni->file.run_lock#3); lock(mapping.invalidate_lock#4); lock(&ni->file.run_lock#3); lock(&mm->mmap_lock); *** DEADLOCK *** 2 locks held by syz.1.257/5546: #0: ffff0000f1ecc360 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1101 [inline] #0: ffff0000f1ecc360 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_fiemap+0xec/0x168 fs/ntfs3/file.c:1242 #1: ffff0000f1ecc410 (&ni->file.run_lock#3){++++}-{3:3}, at: ni_fiemap+0x2c4/0xe10 fs/ntfs3/frecord.c:1962 stack backtrace: CPU: 0 PID: 5546 Comm: syz.1.257 Not tainted 6.1.105-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2048 check_noncircular+0x2cc/0x378 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 kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x3338/0x7680 kernel/locking/lockdep.c:5049 lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5662 __might_fault+0xc4/0x124 mm/memory.c:5835 _copy_to_user include/linux/uaccess.h:143 [inline] copy_to_user include/linux/uaccess.h:169 [inline] fiemap_fill_next_extent+0x1b4/0x424 fs/ioctl.c:144 ni_fiemap+0x744/0xe10 fs/ntfs3/frecord.c:2045 ntfs_fiemap+0x110/0x168 fs/ntfs3/file.c:1244 ioctl_fiemap fs/ioctl.c:219 [inline] do_vfs_ioctl+0x194c/0x26f8 fs/ioctl.c:810 __do_sys_ioctl fs/ioctl.c:868 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0xe4/0x1c8 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585