loop1: detected capacity change from 0 to 4096 ====================================================== WARNING: possible circular locking dependency detected 5.15.105-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/11302 is trying to acquire lock: ffff88804c3c1b60 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:842 [inline] ffff88804c3c1b60 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: filemap_fault+0x708/0x1470 mm/filemap.c:3072 but task is already holding lock: ffff88807e7b6328 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] ffff88807e7b6328 (&mm->mmap_lock#2){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1338 [inline] ffff88807e7b6328 (&mm->mmap_lock#2){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1485 [inline] ffff88807e7b6328 (&mm->mmap_lock#2){++++}-{3:3}, at: exc_page_fault+0x181/0x740 arch/x86/mm/fault.c:1541 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&mm->mmap_lock#2){++++}-{3:3}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622 __might_fault+0xb4/0x110 mm/memory.c:5297 _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+0x1007/0x1230 fs/ntfs3/frecord.c:1894 ntfs_fiemap+0x12e/0x170 fs/ntfs3/file.c:1225 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+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb -> #1 (&ni->ni_lock/4){+.+.}-{3:3}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 ni_lock fs/ntfs3/ntfs_fs.h:1107 [inline] ntfs_readpage+0x18f/0x210 fs/ntfs3/inode.c:714 filemap_read_page+0x166/0x4b0 mm/filemap.c:2386 filemap_update_page mm/filemap.c:2464 [inline] filemap_get_pages mm/filemap.c:2574 [inline] filemap_read+0x15dc/0x2980 mm/filemap.c:2634 call_read_iter include/linux/fs.h:2097 [inline] generic_file_splice_read+0x4ad/0x790 fs/splice.c:311 do_splice_to fs/splice.c:796 [inline] splice_direct_to_actor+0x448/0xc10 fs/splice.c:870 do_splice_direct+0x285/0x3d0 fs/splice.c:979 do_sendfile+0x625/0xff0 fs/read_write.c:1249 __do_sys_sendfile64 fs/read_write.c:1317 [inline] __se_sys_sendfile64+0x178/0x1e0 fs/read_write.c:1303 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb -> #0 (mapping.invalidate_lock#3){.+.+}-{3:3}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1646/0x58b0 kernel/locking/lockdep.c:3787 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5011 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622 down_read+0x3b/0x50 kernel/locking/rwsem.c:1488 filemap_invalidate_lock_shared include/linux/fs.h:842 [inline] filemap_fault+0x708/0x1470 mm/filemap.c:3072 __do_fault+0x139/0x340 mm/memory.c:3871 do_shared_fault mm/memory.c:4261 [inline] do_fault mm/memory.c:4339 [inline] handle_pte_fault mm/memory.c:4594 [inline] __handle_mm_fault mm/memory.c:4729 [inline] handle_mm_fault+0x275d/0x5950 mm/memory.c:4827 do_user_addr_fault arch/x86/mm/fault.c:1397 [inline] handle_page_fault arch/x86/mm/fault.c:1485 [inline] exc_page_fault+0x271/0x740 arch/x86/mm/fault.c:1541 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 copy_user_enhanced_fast_string+0xe/0x40 arch/x86/lib/copy_user_64.S:205 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline] copyout lib/iov_iter.c:157 [inline] copy_page_to_iter_iovec lib/iov_iter.c:228 [inline] __copy_page_to_iter lib/iov_iter.c:861 [inline] copy_page_to_iter+0x49a/0x10d0 lib/iov_iter.c:889 filemap_read+0x20f6/0x2980 mm/filemap.c:2689 call_read_iter include/linux/fs.h:2097 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0xa9f/0xe10 fs/read_write.c:485 ksys_read+0x1a2/0x2c0 fs/read_write.c:623 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb other info that might help us debug this: Chain exists of: mapping.invalidate_lock#3 --> &ni->ni_lock/4 --> &mm->mmap_lock#2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&mm->mmap_lock#2); lock(&ni->ni_lock/4); lock(&mm->mmap_lock#2); lock(mapping.invalidate_lock#3); *** DEADLOCK *** 2 locks held by syz-executor.1/11302: #0: ffff888056644370 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x261/0x300 fs/file.c:1073 #1: ffff88807e7b6328 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #1: ffff88807e7b6328 (&mm->mmap_lock#2){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1338 [inline] #1: ffff88807e7b6328 (&mm->mmap_lock#2){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1485 [inline] #1: ffff88807e7b6328 (&mm->mmap_lock#2){++++}-{3:3}, at: exc_page_fault+0x181/0x740 arch/x86/mm/fault.c:1541 stack backtrace: CPU: 0 PID: 11302 Comm: syz-executor.1 Not tainted 5.15.105-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb 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+0x1646/0x58b0 kernel/locking/lockdep.c:3787 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5011 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622 down_read+0x3b/0x50 kernel/locking/rwsem.c:1488 filemap_invalidate_lock_shared include/linux/fs.h:842 [inline] filemap_fault+0x708/0x1470 mm/filemap.c:3072 __do_fault+0x139/0x340 mm/memory.c:3871 do_shared_fault mm/memory.c:4261 [inline] do_fault mm/memory.c:4339 [inline] handle_pte_fault mm/memory.c:4594 [inline] __handle_mm_fault mm/memory.c:4729 [inline] handle_mm_fault+0x275d/0x5950 mm/memory.c:4827 do_user_addr_fault arch/x86/mm/fault.c:1397 [inline] handle_page_fault arch/x86/mm/fault.c:1485 [inline] exc_page_fault+0x271/0x740 arch/x86/mm/fault.c:1541 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 RIP: 0010:copy_user_enhanced_fast_string+0xe/0x40 arch/x86/lib/copy_user_64.S:206 Code: 89 d1 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 31 c0 0f 01 ca c3 0f 1f 80 00 00 00 00 0f 01 cb 83 fa 40 0f 82 70 ff ff ff 89 d1 a4 31 c0 0f 01 ca c3 66 2e 0f 1f 84 00 00 00 00 00 89 d1 83 f8 RSP: 0018:ffffc900053578b0 EFLAGS: 00050206 RAX: ffffffff8403f201 RBX: 0000000020003040 RCX: 0000000000001000 RDX: 0000000000001000 RSI: ffff888047bb7000 RDI: 0000000020002040 RBP: ffffc90005357d20 R08: dffffc0000000000 R09: ffffed1008f77000 R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000020002040 R13: 0000000000001000 R14: ffff888047bb7000 R15: 00007ffffffff000 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline] copyout lib/iov_iter.c:157 [inline] copy_page_to_iter_iovec lib/iov_iter.c:228 [inline] __copy_page_to_iter lib/iov_iter.c:861 [inline] copy_page_to_iter+0x49a/0x10d0 lib/iov_iter.c:889 filemap_read+0x20f6/0x2980 mm/filemap.c:2689 call_read_iter include/linux/fs.h:2097 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0xa9f/0xe10 fs/read_write.c:485 ksys_read+0x1a2/0x2c0 fs/read_write.c:623 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f32e60e30f9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f32e4655168 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 00007f32e6202f80 RCX: 00007f32e60e30f9 RDX: 0000000000002020 RSI: 0000000020002040 RDI: 0000000000000004 RBP: 00007f32e613eb39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcd28cbdbf R14: 00007f32e4655300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: 89 d1 mov %edx,%ecx 2: c1 e9 03 shr $0x3,%ecx 5: 83 e2 07 and $0x7,%edx 8: f3 48 a5 rep movsq %ds:(%rsi),%es:(%rdi) b: 89 d1 mov %edx,%ecx d: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) f: 31 c0 xor %eax,%eax 11: 0f 01 ca clac 14: c3 retq 15: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 1c: 0f 01 cb stac 1f: 83 fa 40 cmp $0x40,%edx 22: 0f 82 70 ff ff ff jb 0xffffff98 28: 89 d1 mov %edx,%ecx * 2a: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) <-- trapping instruction 2c: 31 c0 xor %eax,%eax 2e: 0f 01 ca clac 31: c3 retq 32: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 39: 00 00 00 3c: 89 d1 mov %edx,%ecx 3e: 83 .byte 0x83 3f: f8 clc