loop0: detected capacity change from 0 to 4096 ============================================ WARNING: possible recursive locking detected syzkaller #0 Not tainted -------------------------------------------- syz.0.17/5910 is trying to acquire lock: ffff88804445f268 (&ni->ni_lock/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1251 [inline] ffff88804445f268 (&ni->ni_lock/5){+.+.}-{4:4}, at: mi_read+0x314/0x610 fs/ntfs3/record.c:148 but task is already holding lock: ffff888037707268 (&ni->ni_lock/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1251 [inline] ffff888037707268 (&ni->ni_lock/5){+.+.}-{4:4}, at: ntfs_link+0x12a/0x2d0 fs/ntfs3/namei.c:151 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&ni->ni_lock/5); lock(&ni->ni_lock/5); *** DEADLOCK *** May be due to missing lock nesting notation locks held by syz.0.17/5910: 6, last CPU#0: #0: ffff88804602a478 (sb_writers#12){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:531 #1: ffff888037707c10 (&type->i_mutex_dir_key#8/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1071 [inline] #1: ffff888037707c10 (&type->i_mutex_dir_key#8/1){+.+.}-{4:4}, at: __start_dirop fs/namei.c:2924 [inline] #1: ffff888037707c10 (&type->i_mutex_dir_key#8/1){+.+.}-{4:4}, at: start_dirop fs/namei.c:2948 [inline] #1: ffff888037707c10 (&type->i_mutex_dir_key#8/1){+.+.}-{4:4}, at: filename_create+0x200/0x370 fs/namei.c:5108 #2: ffff888037707500 (&sb->s_type->i_mutex_key#24){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1026 [inline] #2: ffff888037707500 (&sb->s_type->i_mutex_key#24){+.+.}-{4:4}, at: vfs_link+0x34e/0x650 fs/namei.c:5932 #3: ffff888037707978 (&ni->ni_lock#2/6){+.+.}-{4:4}, at: ni_lock_dir fs/ntfs3/ntfs_fs.h:1256 [inline] #3: ffff888037707978 (&ni->ni_lock#2/6){+.+.}-{4:4}, at: ntfs_link+0xf0/0x2d0 fs/ntfs3/namei.c:149 #4: ffff888037707268 (&ni->ni_lock/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1251 [inline] #4: ffff888037707268 (&ni->ni_lock/5){+.+.}-{4:4}, at: ntfs_link+0x12a/0x2d0 fs/ntfs3/namei.c:151 #5: ffff888043bdc138 (&wnd->rw_lock/1){+.+.}-{4:4}, at: ntfs_look_free_mft+0x170/0xd90 fs/ntfs3/fsntfs.c:600 stack backtrace: CPU: 0 UID: 0 PID: 5910 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_deadlock_bug+0x27a/0x290 kernel/locking/lockdep.c:3085 check_deadlock kernel/locking/lockdep.c:3137 [inline] validate_chain kernel/locking/lockdep.c:3939 [inline] __lock_acquire+0x25db/0x2de0 kernel/locking/lockdep.c:5288 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x197/0x15a0 kernel/locking/mutex.c:821 ni_lock fs/ntfs3/ntfs_fs.h:1251 [inline] mi_read+0x314/0x610 fs/ntfs3/record.c:148 mi_format_new+0x1a1/0x610 fs/ntfs3/record.c:462 ni_add_subrecord+0x107/0x4a0 fs/ntfs3/frecord.c:336 ntfs_look_free_mft+0x4e5/0xd90 fs/ntfs3/fsntfs.c:744 ni_create_attr_list+0xb0a/0x1750 fs/ntfs3/frecord.c:859 ni_ins_attr_ext+0x4a0/0xba0 fs/ntfs3/frecord.c:958 ni_insert_attr fs/ntfs3/frecord.c:1126 [inline] ni_insert_resident fs/ntfs3/frecord.c:1514 [inline] ni_add_name+0x73f/0xd30 fs/ntfs3/frecord.c:2819 ntfs_link_inode+0x134/0x150 fs/ntfs3/inode.c:1962 ntfs_link+0x14f/0x2d0 fs/ntfs3/namei.c:156 vfs_link+0x49a/0x650 fs/namei.c:5943 filename_linkat+0x273/0x5f0 fs/namei.c:6011 __do_sys_linkat fs/namei.c:6037 [inline] __se_sys_linkat+0x60/0x2d0 fs/namei.c:6032 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:0x7efeb159af39 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:00007efeb235e028 EFLAGS: 00000246 ORIG_RAX: 0000000000000109 RAX: ffffffffffffffda RBX: 00007efeb1805fa0 RCX: 00007efeb159af39 RDX: 0000000000000005 RSI: 0000200000000300 RDI: 0000000000000005 RBP: 00007efeb162fee0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000200000000400 R11: 0000000000000246 R12: 0000000000000000 R13: 00007efeb1806038 R14: 00007efeb1805fa0 R15: 00007ffe72806b98