====================================================== WARNING: possible circular locking dependency detected 6.9.0-rc5-syzkaller-00042-ge88c4cfcb7b8 #0 Not tainted ------------------------------------------------------ syz-executor130/5083 is trying to acquire lock: ffff88807a9ef3e0 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:850 [inline] ffff88807a9ef3e0 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: filemap_fault+0x646/0x16a0 mm/filemap.c:3277 but task is already holding lock: ffff888028038730 (&vma->vm_lock->lock){++++}-{3:3}, at: vma_start_read include/linux/mm.h:677 [inline] ffff888028038730 (&vma->vm_lock->lock){++++}-{3:3}, at: lock_vma_under_rcu+0x2f9/0x730 mm/memory.c:5762 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&vma->vm_lock->lock){++++}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 down_write+0x3a/0x50 kernel/locking/rwsem.c:1579 vma_start_write include/linux/mm.h:730 [inline] vma_link+0x2c6/0x550 mm/mmap.c:416 insert_vm_struct+0x1a3/0x260 mm/mmap.c:3339 __bprm_mm_init fs/exec.c:282 [inline] bprm_mm_init fs/exec.c:384 [inline] alloc_bprm+0x543/0xa00 fs/exec.c:1580 kernel_execve+0x99/0xa10 fs/exec.c:2004 try_to_run_init_process init/main.c:1373 [inline] kernel_init+0xe8/0x2b0 init/main.c:1500 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #2 (&mm->mmap_lock){++++}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __might_fault+0xc6/0x120 mm/memory.c:6220 _copy_to_user+0x2a/0xb0 lib/usercopy.c:36 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:2065 ntfs_fiemap+0x132/0x180 fs/ntfs3/file.c:1206 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x1c09/0x2e50 fs/ioctl.c:838 __do_sys_ioctl fs/ioctl.c:902 [inline] __se_sys_ioctl+0x81/0x170 fs/ioctl.c:890 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&ni->file.run_lock#3){++++}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1526 attr_data_get_block+0x2e3/0x2e10 fs/ntfs3/attrib.c:902 ntfs_get_block_vbo+0x36a/0xd00 fs/ntfs3/inode.c:587 do_mpage_readpage+0x829/0x1c80 fs/mpage.c:232 mpage_read_folio+0x108/0x1e0 fs/mpage.c:399 filemap_read_folio+0x1a2/0x790 mm/filemap.c:2331 filemap_fault+0xed1/0x16a0 mm/filemap.c:3381 __do_fault+0x137/0x460 mm/memory.c:4531 do_shared_fault mm/memory.c:4954 [inline] do_fault mm/memory.c:5028 [inline] do_pte_missing mm/memory.c:3880 [inline] handle_pte_fault mm/memory.c:5300 [inline] __handle_mm_fault+0x2361/0x7240 mm/memory.c:5441 handle_mm_fault+0x3c2/0x8a0 mm/memory.c:5606 do_user_addr_fault arch/x86/mm/fault.c:1362 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x446/0x8e0 arch/x86/mm/fault.c:1563 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #0 (mapping.invalidate_lock#3){.+.+}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1526 filemap_invalidate_lock_shared include/linux/fs.h:850 [inline] filemap_fault+0x646/0x16a0 mm/filemap.c:3277 __do_fault+0x137/0x460 mm/memory.c:4531 do_shared_fault mm/memory.c:4954 [inline] do_fault mm/memory.c:5028 [inline] do_pte_missing mm/memory.c:3880 [inline] handle_pte_fault mm/memory.c:5300 [inline] __handle_mm_fault+0x2361/0x7240 mm/memory.c:5441 handle_mm_fault+0x3c2/0x8a0 mm/memory.c:5606 do_user_addr_fault arch/x86/mm/fault.c:1362 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x446/0x8e0 arch/x86/mm/fault.c:1563 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 other info that might help us debug this: Chain exists of: mapping.invalidate_lock#3 --> &mm->mmap_lock --> &vma->vm_lock->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(&vma->vm_lock->lock); lock(&mm->mmap_lock); lock(&vma->vm_lock->lock); rlock(mapping.invalidate_lock#3); *** DEADLOCK *** 1 lock held by syz-executor130/5083: #0: ffff888028038730 (&vma->vm_lock->lock){++++}-{3:3}, at: vma_start_read include/linux/mm.h:677 [inline] #0: ffff888028038730 (&vma->vm_lock->lock){++++}-{3:3}, at: lock_vma_under_rcu+0x2f9/0x730 mm/memory.c:5762 stack backtrace: CPU: 0 PID: 5083 Comm: syz-executor130 Not tainted 6.9.0-rc5-syzkaller-00042-ge88c4cfcb7b8 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1526 filemap_invalidate_lock_shared include/linux/fs.h:850 [inline] filemap_fault+0x646/0x16a0 mm/filemap.c:3277 __do_fault+0x137/0x460 mm/memory.c:4531 do_shared_fault mm/memory.c:4954 [inline] do_fault mm/memory.c:5028 [inline] do_pte_missing mm/memory.c:3880 [inline] handle_pte_fault mm/memory.c:5300 [inline] __handle_mm_fault+0x2361/0x7240 mm/memory.c:5441 handle_mm_fault+0x3c2/0x8a0 mm/memory.c:5606 do_user_addr_fault arch/x86/mm/fault.c:1362 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x446/0x8e0 arch/x86/mm/fault.c:1563 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0033:0x7f65c30d889f Code: a7 c5 09 00 0f 11 04 25 89 00 00 20 48 8b 35 78 a8 0c 00 e8 53 42 03 00 b8 33 00 00 00 48 89 ee 31 d2 66 0f 6f 05 21 c5 09 00 <66> 89 04 25 44 f7 01 20 bf 10 10 00 20 48 b8 2e 2f 66 69 6c 65 32 RSP: 002b:00007ffce9c3b740 EFLAGS: 00010246 RAX: 0000000000000033 RBX: 00007f65c3155066 RCX: 00007f65c310caf9 RDX: 0000000000000000 RSI: 00007f65c315504b RDI: 0000000000000004 RBP: 00007f65c315504b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f65c3155510 R13: 00007f65c3155055 R14: 23f2bfc581b02e40 R15: ad9a13bd00000000