============================================ WARNING: possible recursive locking detected 6.1.100-syzkaller #0 Not tainted -------------------------------------------- syz.4.249/5126 is trying to acquire lock: ffff0000f43ec0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x148/0x1c8 but task is already holding lock: ffff0000f43ec0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x148/0x1c8 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 4 locks held by syz.4.249/5126: #0: ffff0000df3c8fa8 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #0: ffff0000df3c8fa8 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: hfs_file_release+0xcc/0x12c fs/hfs/inode.c:586 #1: ffff0000df3c8df8 (&HFS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfs_file_truncate+0x43c/0xeb0 fs/hfs/extent.c:511 #2: ffff0000f43ec0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfs_find_init+0x148/0x1c8 #3: ffff0000d2cf3b78 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}, at: hfs_extend_file+0xe4/0x1130 fs/hfs/extent.c:397 stack backtrace: CPU: 0 PID: 5126 Comm: syz.4.249 Not tainted 6.1.100-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 __lock_acquire+0x6310/0x7680 kernel/locking/lockdep.c:5049 lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5662 __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799 hfs_find_init+0x148/0x1c8 hfs_ext_read_extent fs/hfs/extent.c:200 [inline] hfs_extend_file+0x270/0x1130 fs/hfs/extent.c:401 hfs_bmap_reserve+0xd0/0x3b4 fs/hfs/btree.c:234 __hfs_ext_write_extent+0x1a0/0x468 fs/hfs/extent.c:121 __hfs_ext_cache_extent+0x84/0x754 fs/hfs/extent.c:174 hfs_file_truncate+0x538/0xeb0 fs/hfs/extent.c:526 hfs_file_release+0xd4/0x12c fs/hfs/inode.c:587 __fput+0x1c8/0x7c8 fs/file_table.c:320 ____fput+0x20/0x30 fs/file_table.c:348 task_work_run+0x240/0x2f0 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x2148/0x3474 arch/arm64/kernel/signal.c:1132 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x9c/0x168 arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585