hfsplus: inconsistency in B*Tree (128,1,255,1,0) hfsplus: xattr searching failed hfsplus: inconsistency in B*Tree (128,1,255,1,0) ============================================ WARNING: possible recursive locking detected syzkaller #0 Not tainted -------------------------------------------- syz.0.17/6731 is trying to acquire lock: ffff0000ddbc8108 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1b8/0x159c fs/hfsplus/extents.c:453 but task is already holding lock: ffff0000ddbc8e88 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1b8/0x159c fs/hfsplus/extents.c:453 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&HFSPLUS_I(inode)->extents_lock); lock(&HFSPLUS_I(inode)->extents_lock); *** DEADLOCK *** May be due to missing lock nesting notation 6 locks held by syz.0.17/6731: #0: ffff0000c75be420 (sb_writers#11){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:499 #1: ffff0000ddbca4b8 (&sb->s_type->i_mutex_key#22){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1027 [inline] #1: ffff0000ddbca4b8 (&sb->s_type->i_mutex_key#22){+.+.}-{4:4}, at: vfs_setxattr+0x138/0x2a8 fs/xattr.c:320 #2: ffff0000ca41a0b0 (&tree->tree_lock){+.+.}-{4:4}, at: hfsplus_find_init+0x154/0x29c fs/hfsplus/bfind.c:28 #3: ffff0000ca41c0b0 (&tree->tree_lock/2){+.+.}-{4:4}, at: hfsplus_find_init+0x154/0x29c fs/hfsplus/bfind.c:28 #4: ffff0000ddbc8e88 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1b8/0x159c fs/hfsplus/extents.c:453 #5: ffff0000ca4180b0 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfsplus_find_init+0x154/0x29c fs/hfsplus/bfind.c:28 stack backtrace: CPU: 0 UID: 0 PID: 6731 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:499 (C) __dump_stack+0x30/0x40 lib/dump_stack.c:94 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 print_deadlock_bug+0x2e8/0x2f0 kernel/locking/lockdep.c:3041 check_deadlock kernel/locking/lockdep.c:3093 [inline] validate_chain kernel/locking/lockdep.c:3895 [inline] __lock_acquire+0x2940/0x30a4 kernel/locking/lockdep.c:5237 lock_acquire+0x140/0x2e0 kernel/locking/lockdep.c:5868 __mutex_lock_common+0x1d0/0x2678 kernel/locking/mutex.c:614 __mutex_lock kernel/locking/mutex.c:776 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:828 hfsplus_file_extend+0x1b8/0x159c fs/hfsplus/extents.c:453 hfsplus_bmap_reserve+0xe4/0x490 fs/hfsplus/btree.c:358 __hfsplus_ext_write_extent+0x1e4/0x4cc fs/hfsplus/extents.c:104 __hfsplus_ext_cache_extent+0x84/0xa88 fs/hfsplus/extents.c:186 hfsplus_ext_read_extent fs/hfsplus/extents.c:218 [inline] hfsplus_file_extend+0x380/0x159c fs/hfsplus/extents.c:457 hfsplus_bmap_reserve+0xe4/0x490 fs/hfsplus/btree.c:358 hfsplus_create_attr+0x198/0x424 fs/hfsplus/attributes.c:221 __hfsplus_setxattr+0x928/0x2004 fs/hfsplus/xattr.c:356 hfsplus_setxattr+0x10c/0x178 fs/hfsplus/xattr.c:434 hfsplus_trusted_setxattr+0x54/0x6c fs/hfsplus/xattr_trusted.c:30 __vfs_setxattr+0x3d8/0x400 fs/xattr.c:200 __vfs_setxattr_noperm+0x120/0x5c4 fs/xattr.c:234 __vfs_setxattr_locked+0x1e8/0x214 fs/xattr.c:295 vfs_setxattr+0x158/0x2a8 fs/xattr.c:321 do_setxattr fs/xattr.c:636 [inline] filename_setxattr+0x20c/0x4f8 fs/xattr.c:665 path_setxattrat+0x2e8/0x320 fs/xattr.c:713 __do_sys_lsetxattr fs/xattr.c:754 [inline] __se_sys_lsetxattr fs/xattr.c:750 [inline] __arm64_sys_lsetxattr+0xc0/0xdc fs/xattr.c:750 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x254 arch/arm64/kernel/syscall.c:49 el0_svc_common+0xe8/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x5c/0x26c arch/arm64/kernel/entry-common.c:724 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:743 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596