============================================ WARNING: possible recursive locking detected 6.9.0-rc7-syzkaller-gfda5695d692c #0 Not tainted -------------------------------------------- syz-executor.2/6772 is trying to acquire lock: ffff0000c8c540b0 (&tree->tree_lock#2/1){+.+.}-{3:3}, at: hfsplus_find_init+0x144/0x1bc but task is already holding lock: ffff0000c8c540b0 (&tree->tree_lock#2/1){+.+.}-{3:3}, at: hfsplus_find_init+0x144/0x1bc other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&tree->tree_lock#2/1); lock(&tree->tree_lock#2/1); *** DEADLOCK *** May be due to missing lock nesting notation 5 locks held by syz-executor.2/6772: #0: ffff0000c8c52420 (sb_writers#17){.+.+}-{0:0}, at: do_ftruncate+0x1e4/0x4cc fs/open.c:178 #1: ffff0000ed7e09c0 (&sb->s_type->i_mutex_key#22){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:795 [inline] #1: ffff0000ed7e09c0 (&sb->s_type->i_mutex_key#22){+.+.}-{3:3}, at: do_truncate fs/open.c:63 [inline] #1: ffff0000ed7e09c0 (&sb->s_type->i_mutex_key#22){+.+.}-{3:3}, at: do_ftruncate+0x3d0/0x4cc fs/open.c:181 #2: ffff0000ed7e07c8 (&hip->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x250/0x9b8 fs/hfsplus/extents.c:576 #3: ffff0000c8c540b0 (&tree->tree_lock#2/1){+.+.}-{3:3}, at: hfsplus_find_init+0x144/0x1bc #4: ffff0000c7fb8108 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1d0/0x1544 fs/hfsplus/extents.c:457 stack backtrace: CPU: 1 PID: 6772 Comm: syz-executor.2 Not tainted 6.9.0-rc7-syzkaller-gfda5695d692c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:317 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:324 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:114 dump_stack+0x1c/0x28 lib/dump_stack.c:123 print_deadlock_bug+0x4e4/0x660 kernel/locking/lockdep.c:3012 check_deadlock kernel/locking/lockdep.c:3062 [inline] validate_chain kernel/locking/lockdep.c:3856 [inline] __lock_acquire+0x5fe4/0x763c kernel/locking/lockdep.c:5137 lock_acquire+0x248/0x73c kernel/locking/lockdep.c:5754 __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:804 hfsplus_find_init+0x144/0x1bc hfsplus_ext_read_extent fs/hfsplus/extents.c:216 [inline] hfsplus_file_extend+0x370/0x1544 fs/hfsplus/extents.c:461 hfsplus_bmap_reserve+0xec/0x474 fs/hfsplus/btree.c:358 __hfsplus_ext_write_extent+0x1e8/0x4ac fs/hfsplus/extents.c:104 __hfsplus_ext_cache_extent+0x84/0xa84 fs/hfsplus/extents.c:186 hfsplus_file_truncate+0x404/0x9b8 fs/hfsplus/extents.c:598 hfsplus_setattr+0x184/0x238 fs/hfsplus/inode.c:265 notify_change+0x9d4/0xc84 fs/attr.c:497 do_truncate fs/open.c:65 [inline] do_ftruncate+0x3e4/0x4cc fs/open.c:181 do_sys_ftruncate fs/open.c:199 [inline] __do_sys_ftruncate fs/open.c:207 [inline] __se_sys_ftruncate fs/open.c:205 [inline] __arm64_sys_ftruncate+0x94/0xec fs/open.c:205 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598