============================================ WARNING: possible recursive locking detected 6.4.0-rc2-syzkaller-00338-ge2065b8c1b01 #0 Not tainted -------------------------------------------- syz-executor.0/10167 is trying to acquire lock: ffff888023e5e0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x16e/0x1f0 but task is already holding lock: ffff888023e5e0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x16e/0x1f0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&tree->tree_lock/1); lock(&tree->tree_lock/1); *** DEADLOCK *** May be due to missing lock nesting notation 5 locks held by syz-executor.0/10167: #0: ffff8880392c2460 (sb_writers#25){.+.+}-{0:0}, at: do_sys_ftruncate+0x24c/0x380 fs/open.c:191 #1: ffff8880378e7128 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:775 [inline] #1: ffff8880378e7128 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: do_truncate+0x20c/0x300 fs/open.c:64 #2: ffff8880378e6f78 (&HFS_I(inode)->extents_lock#2){+.+.}-{3:3}, at: hfs_extend_file+0xff/0x1440 fs/hfs/extent.c:397 #3: ffff888023e5e0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x16e/0x1f0 #4: ffff8880378e34f8 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xff/0x1440 fs/hfs/extent.c:397 stack backtrace: CPU: 0 PID: 10167 Comm: syz-executor.0 Not tainted 6.4.0-rc2-syzkaller-00338-ge2065b8c1b01 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:3001 [inline] check_deadlock kernel/locking/lockdep.c:3044 [inline] validate_chain+0x472a/0x58e0 kernel/locking/lockdep.c:3829 __lock_acquire+0x1295/0x2000 kernel/locking/lockdep.c:5074 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5691 __mutex_lock_common+0x1d8/0x2530 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x1b/0x20 kernel/locking/mutex.c:799 hfs_find_init+0x16e/0x1f0 hfs_ext_read_extent fs/hfs/extent.c:200 [inline] hfs_extend_file+0x31b/0x1440 fs/hfs/extent.c:401 hfs_bmap_reserve+0xd9/0x3f0 fs/hfs/btree.c:234 __hfs_ext_write_extent+0x22e/0x4f0 fs/hfs/extent.c:121 __hfs_ext_cache_extent+0x6a/0x990 fs/hfs/extent.c:174 hfs_ext_read_extent fs/hfs/extent.c:202 [inline] hfs_extend_file+0x344/0x1440 fs/hfs/extent.c:401 hfs_get_block+0x3e4/0xb60 fs/hfs/extent.c:353 __block_write_begin_int+0x548/0x1a50 fs/buffer.c:2064 __block_write_begin fs/buffer.c:2114 [inline] block_write_begin+0x9c/0x1f0 fs/buffer.c:2175 cont_write_begin+0x643/0x880 fs/buffer.c:2534 hfs_write_begin+0x8a/0xd0 fs/hfs/inode.c:58 cont_expand_zero fs/buffer.c:2461 [inline] cont_write_begin+0x316/0x880 fs/buffer.c:2524 hfs_write_begin+0x8a/0xd0 fs/hfs/inode.c:58 hfs_file_truncate+0x1ed/0xa20 fs/hfs/extent.c:494 hfs_inode_setattr+0x461/0x6a0 fs/hfs/inode.c:656 notify_change+0xc8b/0xf40 fs/attr.c:483 do_truncate+0x220/0x300 fs/open.c:66 do_sys_ftruncate+0x2e4/0x380 fs/open.c:194 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7efdf7c8c169 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:00007efdf8a63168 EFLAGS: 00000246 ORIG_RAX: 000000000000004d RAX: ffffffffffffffda RBX: 00007efdf7dabf80 RCX: 00007efdf7c8c169 RDX: 0000000000000000 RSI: 0000000002007ffb RDI: 0000000000000005 RBP: 00007efdf7ce7ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffeed8b62bf R14: 00007efdf8a63300 R15: 0000000000022000