====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.3.192/9072 is trying to acquire lock: ffff888037e59f30 (&mm->mmap_lock){++++}-{4:4}, at: mmap_read_lock_killable+0x1d/0x70 include/linux/mmap_lock.h:609 but task is already holding lock: ffff888064e800f0 (&ni->ni_lock#2/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1247 [inline] ffff888064e800f0 (&ni->ni_lock#2/5){+.+.}-{4:4}, at: ntfs_readdir+0x717/0xf70 fs/ntfs3/dir.c:541 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ni->ni_lock#2/5){+.+.}-{4:4}: __mutex_lock_common kernel/locking/rtmutex_api.c:561 [inline] mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:580 ni_lock fs/ntfs3/ntfs_fs.h:1247 [inline] attr_data_get_block+0x1cd/0x2c0 fs/ntfs3/attrib.c:976 ntfs_file_mmap_prepare+0x5b3/0xa20 fs/ntfs3/file.c:430 vfs_mmap_prepare include/linux/fs.h:2069 [inline] call_mmap_prepare mm/vma.c:2776 [inline] __mmap_region mm/vma.c:2865 [inline] mmap_region+0xea5/0x2220 mm/vma.c:2966 do_mmap+0xe0e/0x1310 mm/mmap.c:573 vm_mmap_pgoff+0x275/0x4e0 mm/util.c:581 ksys_mmap_pgoff+0x4a6/0x720 mm/mmap.c:619 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&mm->mmap_lock){++++}-{4:4}: check_prev_add kernel/locking/lockdep.c:3209 [inline] check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x164c/0x2de0 kernel/locking/lockdep.c:5288 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942 down_read_killable+0xa4/0x220 kernel/locking/rwsem.c:1599 mmap_read_lock_killable+0x1d/0x70 include/linux/mmap_lock.h:609 get_mmap_lock_carefully mm/mmap_lock.c:450 [inline] lock_mm_and_find_vma+0x2d6/0x340 mm/mmap_lock.c:501 do_user_addr_fault+0x343/0x1340 arch/x86/mm/fault.c:1366 handle_page_fault arch/x86/mm/fault.c:1483 [inline] exc_page_fault+0x6a/0xc0 arch/x86/mm/fault.c:1536 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:595 filldir64+0x2bc/0x620 fs/readdir.c:-1 dir_emit include/linux/fs.h:3607 [inline] ntfs_dir_emit fs/ntfs3/dir.c:388 [inline] ntfs_read_hdr+0x8a7/0xc10 fs/ntfs3/dir.c:429 ntfs_readdir+0x9ab/0xf70 fs/ntfs3/dir.c:589 iterate_dir+0x2f1/0x4e0 fs/readdir.c:110 __do_sys_getdents64 fs/readdir.c:399 [inline] __se_sys_getdents64+0xf1/0x280 fs/readdir.c:384 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ni->ni_lock#2/5); lock(&mm->mmap_lock); lock(&ni->ni_lock#2/5); rlock(&mm->mmap_lock); *** DEADLOCK *** locks held by syz.3.192/9072: 3, last CPU#1: #0: ffff888037543528 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x252/0x320 fs/file.c:1259 #1: ffff888064e803b8 (&type->i_mutex_dir_key#18){++++}-{4:4}, at: iterate_dir+0x215/0x4e0 fs/readdir.c:103 #2: ffff888064e800f0 (&ni->ni_lock#2/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1247 [inline] #2: ffff888064e800f0 (&ni->ni_lock#2/5){+.+.}-{4:4}, at: ntfs_readdir+0x717/0xf70 fs/ntfs3/dir.c:541 stack backtrace: CPU: 1 UID: 0 PID: 9072 Comm: syz.3.192 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_circular_bug+0x2e2/0x300 kernel/locking/lockdep.c:2087 check_noncircular+0x12f/0x150 kernel/locking/lockdep.c:2219 check_prev_add kernel/locking/lockdep.c:3209 [inline] check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x164c/0x2de0 kernel/locking/lockdep.c:5288 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942 down_read_killable+0xa4/0x220 kernel/locking/rwsem.c:1599 mmap_read_lock_killable+0x1d/0x70 include/linux/mmap_lock.h:609 get_mmap_lock_carefully mm/mmap_lock.c:450 [inline] lock_mm_and_find_vma+0x2d6/0x340 mm/mmap_lock.c:501 do_user_addr_fault+0x343/0x1340 arch/x86/mm/fault.c:1366 handle_page_fault arch/x86/mm/fault.c:1483 [inline] exc_page_fault+0x6a/0xc0 arch/x86/mm/fault.c:1536 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:595 RIP: 0010:filldir64+0x2bc/0x620 fs/readdir.c:369 Code: ea 2f 7f ff 0f 01 cb 48 8b 44 24 28 49 89 47 08 48 bd 00 00 00 00 00 fc ff df 48 8b 44 24 58 48 89 03 8b 4c 24 04 48 8d 43 10 <66> 89 08 8b 4c 24 14 80 e1 0f 48 8d 43 12 88 08 4a 8d 04 2b 48 83 RSP: 0018:ffffc90002b3fab0 EFLAGS: 00050293 RAX: 0000200000001000 RBX: 0000200000000ff0 RCX: 0000000000000020 RDX: 0000000000000000 RSI: 0000000000000008 RDI: 0000000000000007 RBP: dffffc0000000000 R08: 0000000000000000 R09: 0000000000000000 R10: dffffc0000000000 R11: ffffed10022b37d1 R12: ffff888065fbc000 R13: 0000000000000008 R14: 0000000000000008 R15: 0000200000000fd8 dir_emit include/linux/fs.h:3607 [inline] ntfs_dir_emit fs/ntfs3/dir.c:388 [inline] ntfs_read_hdr+0x8a7/0xc10 fs/ntfs3/dir.c:429 ntfs_readdir+0x9ab/0xf70 fs/ntfs3/dir.c:589 iterate_dir+0x2f1/0x4e0 fs/readdir.c:110 __do_sys_getdents64 fs/readdir.c:399 [inline] __se_sys_getdents64+0xf1/0x280 fs/readdir.c:384 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f317963e159 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3177875028 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007f31798c6090 RCX: 00007f317963e159 RDX: 00000000000000e0 RSI: 0000200000000fc0 RDI: 0000000000000005 RBP: 00007f31796d506b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f31798c6128 R14: 00007f31798c6090 R15: 00007ffc5ee85258 ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 7f ff jg 0x1 2: 0f 01 cb stac 5: 48 8b 44 24 28 mov 0x28(%rsp),%rax a: 49 89 47 08 mov %rax,0x8(%r15) e: 48 bd 00 00 00 00 00 movabs $0xdffffc0000000000,%rbp 15: fc ff df 18: 48 8b 44 24 58 mov 0x58(%rsp),%rax 1d: 48 89 03 mov %rax,(%rbx) 20: 8b 4c 24 04 mov 0x4(%rsp),%ecx 24: 48 8d 43 10 lea 0x10(%rbx),%rax * 28: 66 89 08 mov %cx,(%rax) <-- trapping instruction 2b: 8b 4c 24 14 mov 0x14(%rsp),%ecx 2f: 80 e1 0f and $0xf,%cl 32: 48 8d 43 12 lea 0x12(%rbx),%rax 36: 88 08 mov %cl,(%rax) 38: 4a 8d 04 2b lea (%rbx,%r13,1),%rax 3c: 48 rex.W 3d: 83 .byte 0x83