====================================================== WARNING: possible circular locking dependency detected 6.14.0-rc2-syzkaller-00041-g4dc1d1bec898 #0 Not tainted ------------------------------------------------------ syz.3.557/13308 is trying to acquire lock: ffff88805a18c750 (mapping.invalidate_lock#3){.+.+}-{4:4}, at: filemap_invalidate_lock_shared include/linux/fs.h:932 [inline] ffff88805a18c750 (mapping.invalidate_lock#3){.+.+}-{4:4}, at: filemap_fault+0x7f8/0x16c0 mm/filemap.c:3435 but task is already holding lock: ffff888054f61580 (&vma->vm_lock->lock){++++}-{4:4}, at: vma_start_read include/linux/mm.h:717 [inline] ffff888054f61580 (&vma->vm_lock->lock){++++}-{4:4}, at: lock_vma_under_rcu+0x34b/0x790 mm/memory.c:6367 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&vma->vm_lock->lock){++++}-{4:4}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 down_write+0x99/0x220 kernel/locking/rwsem.c:1577 vma_start_write include/linux/mm.h:770 [inline] vma_link+0x28c/0x500 mm/vma.c:1692 insert_vm_struct+0x2f7/0x410 mm/mmap.c:1356 __bprm_mm_init fs/exec.c:281 [inline] bprm_mm_init fs/exec.c:385 [inline] alloc_bprm+0x7f9/0xbe0 fs/exec.c:1575 kernel_execve+0x99/0xa50 fs/exec.c:1991 try_to_run_init_process init/main.c:1385 [inline] kernel_init+0xed/0x2b0 init/main.c:1513 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #2 (&mm->mmap_lock){++++}-{4:4}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 __might_fault+0xc6/0x120 mm/memory.c:6840 _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+0x235/0x410 fs/ioctl.c:145 ni_fiemap+0x96b/0x1220 fs/ntfs3/frecord.c:2042 ntfs_fiemap+0x132/0x180 fs/ntfs3/file.c:1360 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x1c01/0x2e40 fs/ioctl.c:840 __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl+0x80/0x170 fs/ioctl.c:892 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 (&ni->ni_lock#3/5){+.+.}-{4:4}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19c/0x1010 kernel/locking/mutex.c:730 ni_lock fs/ntfs3/ntfs_fs.h:1111 [inline] attr_data_get_block+0x464/0x2fb0 fs/ntfs3/attrib.c:918 ntfs_get_block_vbo+0x3d7/0xd70 fs/ntfs3/inode.c:605 do_mpage_readpage+0x7b8/0x1720 fs/mpage.c:225 mpage_readahead+0x456/0x780 fs/mpage.c:374 read_pages+0x179/0x570 mm/readahead.c:161 page_cache_ra_unbounded+0x708/0x820 mm/readahead.c:298 filemap_get_pages+0x59a/0x1fb0 mm/filemap.c:2580 filemap_read+0x464/0x1260 mm/filemap.c:2691 __kernel_read+0x52e/0xa00 fs/read_write.c:523 integrity_kernel_read+0xb0/0x100 security/integrity/iint.c:28 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:480 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:511 [inline] ima_calc_file_hash+0xae6/0x1b30 security/integrity/ima/ima_crypto.c:568 ima_collect_measurement+0x520/0xb10 security/integrity/ima/ima_api.c:293 process_measurement+0x1351/0x1fb0 security/integrity/ima/ima_main.c:372 ima_file_check+0xd9/0x120 security/integrity/ima/ima_main.c:600 security_file_post_open+0xb9/0x280 security/security.c:3130 do_open fs/namei.c:3832 [inline] path_openat+0x2cca/0x3590 fs/namei.c:3989 do_filp_open+0x27f/0x4e0 fs/namei.c:4016 do_sys_openat2+0x13e/0x1d0 fs/open.c:1428 do_sys_open fs/open.c:1443 [inline] __do_sys_open fs/open.c:1451 [inline] __se_sys_open fs/open.c:1447 [inline] __x64_sys_open+0x225/0x270 fs/open.c:1447 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 (mapping.invalidate_lock#3){.+.+}-{4:4}: check_prev_add kernel/locking/lockdep.c:3163 [inline] check_prevs_add kernel/locking/lockdep.c:3282 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3906 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5228 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1524 filemap_invalidate_lock_shared include/linux/fs.h:932 [inline] filemap_fault+0x7f8/0x16c0 mm/filemap.c:3435 __do_fault+0x135/0x390 mm/memory.c:4977 do_read_fault mm/memory.c:5392 [inline] do_fault mm/memory.c:5526 [inline] do_pte_missing mm/memory.c:4047 [inline] handle_pte_fault mm/memory.c:5889 [inline] __handle_mm_fault+0x4c44/0x70f0 mm/memory.c:6032 handle_mm_fault+0x2c1/0x7e0 mm/memory.c:6201 do_user_addr_fault arch/x86/mm/fault.c:1337 [inline] handle_page_fault arch/x86/mm/fault.c:1480 [inline] exc_page_fault+0x459/0x8b0 arch/x86/mm/fault.c:1538 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.3.557/13308: #0: ffff888054f61580 (&vma->vm_lock->lock){++++}-{4:4}, at: vma_start_read include/linux/mm.h:717 [inline] #0: ffff888054f61580 (&vma->vm_lock->lock){++++}-{4:4}, at: lock_vma_under_rcu+0x34b/0x790 mm/memory.c:6367 stack backtrace: CPU: 0 UID: 0 PID: 13308 Comm: syz.3.557 Not tainted 6.14.0-rc2-syzkaller-00041-g4dc1d1bec898 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2076 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2208 check_prev_add kernel/locking/lockdep.c:3163 [inline] check_prevs_add kernel/locking/lockdep.c:3282 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3906 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5228 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1524 filemap_invalidate_lock_shared include/linux/fs.h:932 [inline] filemap_fault+0x7f8/0x16c0 mm/filemap.c:3435 __do_fault+0x135/0x390 mm/memory.c:4977 do_read_fault mm/memory.c:5392 [inline] do_fault mm/memory.c:5526 [inline] do_pte_missing mm/memory.c:4047 [inline] handle_pte_fault mm/memory.c:5889 [inline] __handle_mm_fault+0x4c44/0x70f0 mm/memory.c:6032 handle_mm_fault+0x2c1/0x7e0 mm/memory.c:6201 do_user_addr_fault arch/x86/mm/fault.c:1337 [inline] handle_page_fault arch/x86/mm/fault.c:1480 [inline] exc_page_fault+0x459/0x8b0 arch/x86/mm/fault.c:1538 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0033:0x7f867cc4f9e1 Code: 39 c6 7e 57 4c 8b 5f 20 48 8b 57 28 eb 06 0f 1f 00 4c 89 c2 49 39 d3 74 47 4c 8b 57 18 4c 8d 42 01 89 c1 83 c0 08 4c 89 47 28 <41> 0f b6 14 12 89 47 34 48 d3 e2 49 09 d1 39 f0 7c d5 44 89 ca 29 RSP: 002b:00007f867dc664e8 EFLAGS: 00010202 RAX: 0000000000000008 RBX: 00007f867dc66e28 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 00007f867dc665e0 RBP: 00007f867dc665e0 R08: 0000000000000001 R09: 0000000000000000 R10: 0000400000001402 R11: 00000000000005cb R12: 0000000000000005 R13: 00007f867dc66ef0 R14: 00007f867dc66eb0 R15: 00007f8672600000