====================================================== WARNING: possible circular locking dependency detected 5.15.164-syzkaller #0 Not tainted ------------------------------------------------------ syz.1.2500/13836 is trying to acquire lock: ffff8880601cc040 (mapping.invalidate_lock#9){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:844 [inline] ffff8880601cc040 (mapping.invalidate_lock#9){.+.+}-{3:3}, at: filemap_fault+0x708/0x1470 mm/filemap.c:3081 but task is already holding lock: ffff8880791f9d28 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] ffff8880791f9d28 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1298 [inline] ffff8880791f9d28 (&mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1445 [inline] ffff8880791f9d28 (&mm->mmap_lock){++++}-{3:3}, at: exc_page_fault+0x181/0x700 arch/x86/mm/fault.c:1501 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&mm->mmap_lock){++++}-{3:3}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __might_fault+0xb4/0x110 mm/memory.c:5328 _copy_to_user+0x28/0x130 lib/usercopy.c:35 copy_to_user include/linux/uaccess.h:200 [inline] fiemap_fill_next_extent+0x231/0x410 fs/ioctl.c:144 ni_fiemap+0x9ae/0x1230 fs/ntfs3/frecord.c:1996 ntfs_fiemap+0x12e/0x170 fs/ntfs3/file.c:1227 ioctl_fiemap fs/ioctl.c:219 [inline] do_vfs_ioctl+0x1934/0x2b70 fs/ioctl.c:814 __do_sys_ioctl fs/ioctl.c:872 [inline] __se_sys_ioctl+0x81/0x160 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #1 (&ni->file.run_lock){++++}-{3:3}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 down_read+0x45/0x2e0 kernel/locking/rwsem.c:1498 attr_data_get_block+0x26a/0x24e0 fs/ntfs3/attrib.c:828 ntfs_get_block_vbo+0x3bc/0x1070 fs/ntfs3/inode.c:591 do_mpage_readpage+0x6c8/0x1f70 fs/mpage.c:231 mpage_readahead+0x427/0x9b0 fs/mpage.c:389 read_pages+0x159/0x8e0 mm/readahead.c:130 page_cache_ra_unbounded+0x7b0/0x930 mm/readahead.c:239 page_cache_sync_readahead include/linux/pagemap.h:833 [inline] filemap_get_pages mm/filemap.c:2551 [inline] filemap_read+0x71c/0x2980 mm/filemap.c:2634 __kernel_read+0x5ac/0xa60 fs/read_write.c:443 integrity_kernel_read+0xac/0xf0 security/integrity/iint.c:228 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:485 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:516 [inline] ima_calc_file_hash+0xa5d/0x1c00 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x37e/0x800 security/integrity/ima/ima_api.c:255 process_measurement+0x1363/0x21c0 security/integrity/ima/ima_main.c:351 ima_file_check+0xf3/0x180 security/integrity/ima/ima_main.c:533 do_open fs/namei.c:3610 [inline] path_openat+0x2748/0x2f20 fs/namei.c:3742 do_filp_open+0x21c/0x460 fs/namei.c:3769 do_sys_openat2+0x13b/0x4f0 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_openat fs/open.c:1285 [inline] __se_sys_openat fs/open.c:1280 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1280 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (mapping.invalidate_lock#9){.+.+}-{3:3}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 down_read+0x45/0x2e0 kernel/locking/rwsem.c:1498 filemap_invalidate_lock_shared include/linux/fs.h:844 [inline] filemap_fault+0x708/0x1470 mm/filemap.c:3081 __do_fault+0x139/0x340 mm/memory.c:3898 do_read_fault mm/memory.c:4234 [inline] do_fault mm/memory.c:4362 [inline] handle_pte_fault mm/memory.c:4621 [inline] __handle_mm_fault mm/memory.c:4756 [inline] handle_mm_fault+0x376f/0x5950 mm/memory.c:4854 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 strncpy_from_user+0x170/0x370 lib/strncpy_from_user.c:139 getname_flags+0xf5/0x4e0 fs/namei.c:149 getname fs/namei.c:217 [inline] __do_sys_mkdirat fs/namei.c:4105 [inline] __se_sys_mkdirat fs/namei.c:4103 [inline] __x64_sys_mkdirat+0x78/0x90 fs/namei.c:4103 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Chain exists of: mapping.invalidate_lock#9 --> &ni->file.run_lock --> &mm->mmap_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&mm->mmap_lock); lock(&ni->file.run_lock); lock(&mm->mmap_lock); lock(mapping.invalidate_lock#9); *** DEADLOCK *** 1 lock held by syz.1.2500/13836: #0: ffff8880791f9d28 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff8880791f9d28 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1298 [inline] #0: ffff8880791f9d28 (&mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1445 [inline] #0: ffff8880791f9d28 (&mm->mmap_lock){++++}-{3:3}, at: exc_page_fault+0x181/0x700 arch/x86/mm/fault.c:1501 stack backtrace: CPU: 0 PID: 13836 Comm: syz.1.2500 Not tainted 5.15.164-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2f8/0x3b0 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 down_read+0x45/0x2e0 kernel/locking/rwsem.c:1498 filemap_invalidate_lock_shared include/linux/fs.h:844 [inline] filemap_fault+0x708/0x1470 mm/filemap.c:3081 __do_fault+0x139/0x340 mm/memory.c:3898 do_read_fault mm/memory.c:4234 [inline] do_fault mm/memory.c:4362 [inline] handle_pte_fault mm/memory.c:4621 [inline] __handle_mm_fault mm/memory.c:4756 [inline] handle_mm_fault+0x376f/0x5950 mm/memory.c:4854 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 RIP: 0010:do_strncpy_from_user lib/strncpy_from_user.c:41 [inline] RIP: 0010:strncpy_from_user+0x170/0x370 lib/strncpy_from_user.c:139 Code: 4c 89 ee e8 02 18 56 fd 49 83 fd 07 0f 86 a2 00 00 00 4c 89 7c 24 08 48 c7 44 24 10 f8 ff ff ff 45 31 e4 4c 89 f5 48 8b 04 24 <4e> 8b 3c 20 48 b8 ff fe fe fe fe fe fe fe 49 8d 1c 07 4d 89 fe 49 RSP: 0018:ffffc90002ee7e60 EFLAGS: 00050246 RAX: 0000000020000100 RBX: 00007ffffffff000 RCX: ffff88801b0e0000 RDX: 0000000000000000 RSI: 0000000000000fe0 RDI: 0000000000000007 RBP: ffff88805bbee620 R08: ffffffff842a4d3e R09: 0000000000001000 R10: ffff888011df2500 R11: dffffc0000000001 R12: 0000000000000000 R13: 0000000000000fe0 R14: ffff88805bbee620 R15: 0000000000000fe0 getname_flags+0xf5/0x4e0 fs/namei.c:149 getname fs/namei.c:217 [inline] __do_sys_mkdirat fs/namei.c:4105 [inline] __se_sys_mkdirat fs/namei.c:4103 [inline] __x64_sys_mkdirat+0x78/0x90 fs/namei.c:4103 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f2cb9bc7bd7 Code: 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 02 01 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2cb8047e78 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f2cb8047f00 RCX: 00007f2cb9bc7bd7 RDX: 00000000000001ff RSI: 0000000020000100 RDI: 00000000ffffff9c RBP: 0000000020000000 R08: 0000000020000000 R09: 0000000000000000 R10: 0000000020000000 R11: 0000000000000246 R12: 0000000020000100 R13: 00007f2cb8047ec0 R14: 0000000000000000 R15: 0000000000000000 FAULT_INJECTION: forcing a failure. name fail_usercopy, interval 1, probability 0, space 0, times 0 CPU: 0 PID: 13836 Comm: syz.1.2500 Not tainted 5.15.164-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 fail_dump lib/fault-inject.c:52 [inline] should_fail+0x38a/0x4c0 lib/fault-inject.c:146 __copy_to_user include/linux/uaccess.h:144 [inline] save_xstate_epilog arch/x86/kernel/fpu/signal.c:104 [inline] copy_fpstate_to_sigframe+0x85d/0xb40 arch/x86/kernel/fpu/signal.c:217 get_sigframe+0x378/0x4b0 arch/x86/kernel/signal.c:295 __setup_rt_frame arch/x86/kernel/signal.c:471 [inline] setup_rt_frame arch/x86/kernel/signal.c:780 [inline] handle_signal arch/x86/kernel/signal.c:824 [inline] arch_do_signal_or_restart+0x4ac/0x1890 arch/x86/kernel/signal.c:869 handle_signal_work kernel/entry/common.c:154 [inline] exit_to_user_mode_loop+0x97/0x130 kernel/entry/common.c:178 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:320 exc_page_fault+0x342/0x700 arch/x86/mm/fault.c:1504 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 RIP: 0033:0x7f2cb9ba1bb9 Code: f8 77 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 89 f8 48 89 fa c5 f9 ef c0 25 ff 0f 00 00 3d e0 0f 00 00 0f 87 27 01 00 00 fd 74 0f c5 fd d7 c1 85 c0 74 5b f3 0f bc c0 e9 30 01 00 00 66 RSP: 002b:00007f2cb8047e78 EFLAGS: 00010283 RAX: 0000000000000000 RBX: 00007f2cb8047f00 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000020000100 RDI: 0000000000000000 RBP: 0000000020000000 R08: 0000000020000000 R09: 0000000000000000 R10: 0000000020000000 R11: 0000000000000246 R12: 0000000020000100 R13: 00007f2cb8047ec0 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess): 0: 4c 89 ee mov %r13,%rsi 3: e8 02 18 56 fd call 0xfd56180a 8: 49 83 fd 07 cmp $0x7,%r13 c: 0f 86 a2 00 00 00 jbe 0xb4 12: 4c 89 7c 24 08 mov %r15,0x8(%rsp) 17: 48 c7 44 24 10 f8 ff movq $0xfffffffffffffff8,0x10(%rsp) 1e: ff ff 20: 45 31 e4 xor %r12d,%r12d 23: 4c 89 f5 mov %r14,%rbp 26: 48 8b 04 24 mov (%rsp),%rax * 2a: 4e 8b 3c 20 mov (%rax,%r12,1),%r15 <-- trapping instruction 2e: 48 b8 ff fe fe fe fe movabs $0xfefefefefefefeff,%rax 35: fe fe fe 38: 49 8d 1c 07 lea (%r15,%rax,1),%rbx 3c: 4d 89 fe mov %r15,%r14 3f: 49 rex.WB