loop0: detected capacity change from 0 to 1024 hfsplus: xattr searching failed hfsplus: xattr searching failed ============================================ WARNING: possible recursive locking detected 6.14.0-rc4-syzkaller-00282-g1973160c90d7 #0 Not tainted -------------------------------------------- syz-executor387/5309 is trying to acquire lock: ffff8880131000b0 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfsplus_find_init+0x14a/0x1c0 fs/hfsplus/bfind.c:28 but task is already holding lock: ffff8880131000b0 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfsplus_find_init+0x14a/0x1c0 fs/hfsplus/bfind.c:28 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-executor387/5309: #0: ffff888043452420 (sb_writers#9){.+.+}-{0:0}, at: do_ftruncate+0x44f/0x540 fs/open.c:191 #1: ffff888041296b78 (&sb->s_type->i_mutex_key#15){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:877 [inline] #1: ffff888041296b78 (&sb->s_type->i_mutex_key#15){+.+.}-{4:4}, at: do_truncate+0x20c/0x310 fs/open.c:63 #2: ffff888041296988 (&hip->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x21b/0x1b70 fs/hfsplus/extents.c:458 #3: ffff8880131000b0 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfsplus_find_init+0x14a/0x1c0 fs/hfsplus/bfind.c:28 #4: ffff888041294108 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x21b/0x1b70 fs/hfsplus/extents.c:458 stack backtrace: CPU: 0 UID: 0 PID: 5309 Comm: syz-executor387 Not tainted 6.14.0-rc4-syzkaller-00282-g1973160c90d7 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3039 check_deadlock kernel/locking/lockdep.c:3091 [inline] validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3893 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5228 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19c/0x1010 kernel/locking/mutex.c:730 hfsplus_find_init+0x14a/0x1c0 fs/hfsplus/bfind.c:28 hfsplus_ext_read_extent fs/hfsplus/extents.c:216 [inline] hfsplus_file_extend+0x454/0x1b70 fs/hfsplus/extents.c:462 hfsplus_bmap_reserve+0x105/0x4e0 fs/hfsplus/btree.c:358 __hfsplus_ext_write_extent+0x2a4/0x5c0 fs/hfsplus/extents.c:104 __hfsplus_ext_cache_extent+0x84/0xe10 fs/hfsplus/extents.c:186 hfsplus_ext_read_extent fs/hfsplus/extents.c:218 [inline] hfsplus_file_extend+0x48c/0x1b70 fs/hfsplus/extents.c:462 hfsplus_get_block+0x406/0x14f0 fs/hfsplus/extents.c:245 __block_write_begin_int+0x692/0x19a0 fs/buffer.c:2116 block_write_begin fs/buffer.c:2226 [inline] cont_write_begin+0x77f/0xb40 fs/buffer.c:2577 hfsplus_write_begin+0x68/0xb0 fs/hfsplus/inode.c:46 cont_expand_zero fs/buffer.c:2504 [inline] cont_write_begin+0x32b/0xb40 fs/buffer.c:2567 hfsplus_write_begin+0x68/0xb0 fs/hfsplus/inode.c:46 generic_cont_expand_simple+0x18f/0x2b0 fs/buffer.c:2468 hfsplus_setattr+0x16d/0x270 fs/hfsplus/inode.c:258 notify_change+0xbca/0xe90 fs/attr.c:552 do_truncate+0x220/0x310 fs/open.c:65 do_ftruncate+0x4a1/0x540 fs/open.c:192 do_sys_ftruncate fs/open.c:207 [inline] __do_sys_ftruncate fs/open.c:212 [inline] __se_sys_ftruncate fs/open.c:210 [inline] __x64_sys_ftruncate+0x94/0xf0 fs/open.c:210 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe461ac3ad9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 17 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:00007ffc4baccf88 EFLAGS: 00000246 ORIG_RAX: 000000000000004d RAX: ffffffffffffffda RBX: 0031656c69662f2e RCX: 00007fe461ac3ad9 RDX: 00007fe461ac3ad9 RSI: 0000000008800000 RDI: 0000000000000004 RBP: 00007fe461b375f0 R08: 0000555570c404c0 R09: 0000555570c404c0 R10: 00000000000006d5 R11: 0000000000000246 R12: 00007ffc4baccfb0 R13: 00007ffc4bacd1d8 R14: 431bde82d7b634db R15: 00007fe461b0c03b