====================================================== WARNING: possible circular locking dependency detected 6.8.0-rc7-syzkaller-00051-g67be068d31d4 #0 Not tainted ------------------------------------------------------ syz-executor878/5175 is trying to acquire lock: ffff8880217687c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1c1/0x1090 fs/hfsplus/extents.c:457 but task is already holding lock: ffff8880290a00b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_find_init+0x1a7/0x200 fs/hfsplus/bfind.c:30 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&tree->tree_lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9d0 kernel/locking/mutex.c:752 hfsplus_file_truncate+0x886/0x9e0 fs/hfsplus/extents.c:595 hfsplus_delete_inode+0x18f/0x220 fs/hfsplus/inode.c:450 hfsplus_unlink+0x583/0x7f0 fs/hfsplus/dir.c:405 vfs_unlink+0x2fb/0x910 fs/namei.c:4338 do_unlinkat+0x5c0/0x750 fs/namei.c:4402 __do_sys_unlinkat fs/namei.c:4445 [inline] __se_sys_unlinkat fs/namei.c:4438 [inline] __x64_sys_unlinkat+0xc1/0x130 fs/namei.c:4438 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd5/0x270 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6f/0x77 -> #0 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x244f/0x3b40 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9d0 kernel/locking/mutex.c:752 hfsplus_file_extend+0x1c1/0x1090 fs/hfsplus/extents.c:457 hfsplus_bmap_reserve+0x31c/0x410 fs/hfsplus/btree.c:358 hfsplus_rename_cat+0x2b1/0x1240 fs/hfsplus/catalog.c:456 hfsplus_unlink+0x492/0x7f0 fs/hfsplus/dir.c:376 vfs_unlink+0x2fb/0x910 fs/namei.c:4338 do_unlinkat+0x5c0/0x750 fs/namei.c:4402 do_coredump+0x188d/0x3f80 fs/coredump.c:675 get_signal+0x2433/0x2790 kernel/signal.c:2879 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:105 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] irqentry_exit_to_user_mode+0x13c/0x280 kernel/entry/common.c:225 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&tree->tree_lock); lock(&HFSPLUS_I(inode)->extents_lock); lock(&tree->tree_lock); lock(&HFSPLUS_I(inode)->extents_lock); *** DEADLOCK *** 5 locks held by syz-executor878/5175: #0: ffff88802ba0a420 (sb_writers#10){.+.+}-{0:0}, at: do_unlinkat+0x1d3/0x750 fs/namei.c:4385 #1: ffff888021769e00 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:839 [inline] #1: ffff888021769e00 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: do_unlinkat+0x288/0x750 fs/namei.c:4389 #2: ffff88801ee70300 (&sb->s_type->i_mutex_key#17){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline] #2: ffff88801ee70300 (&sb->s_type->i_mutex_key#17){+.+.}-{3:3}, at: vfs_unlink+0xd3/0x910 fs/namei.c:4327 #3: ffff8880296a6198 (&sbi->vh_mutex){+.+.}-{3:3}, at: hfsplus_unlink+0x184/0x7f0 fs/hfsplus/dir.c:370 #4: ffff8880290a00b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_find_init+0x1a7/0x200 fs/hfsplus/bfind.c:30 stack backtrace: CPU: 0 PID: 5175 Comm: syz-executor878 Not tainted 6.8.0-rc7-syzkaller-00051-g67be068d31d4 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x31b/0x400 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x244f/0x3b40 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9d0 kernel/locking/mutex.c:752 hfsplus_file_extend+0x1c1/0x1090 fs/hfsplus/extents.c:457 hfsplus_bmap_reserve+0x31c/0x410 fs/hfsplus/btree.c:358 hfsplus_rename_cat+0x2b1/0x1240 fs/hfsplus/catalog.c:456 hfsplus_unlink+0x492/0x7f0 fs/hfsplus/dir.c:376 vfs_unlink+0x2fb/0x910 fs/namei.c:4338 do_unlinkat+0x5c0/0x750 fs/namei.c:4402 do_coredump+0x188d/0x3f80 fs/coredump.c:675 get_signal+0x2433/0x2790 kernel/signal.c:2879 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:105 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] irqentry_exit_to_user_mode+0x13c/0x280 kernel/entry/common.c:225 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0x0 Code: Unable to access opcode bytes at 0xffffffffffffffd6. RSP: 002b:0000000020000048 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 000000000000001c RCX: 00007f92bc4c47c9 RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000080 RBP: 00007ffd47a93570 R08: 0000000000000000 R09: 00007ffd47a935d0 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f92bc5385f0 R13: 00007ffd47a93758 R14: 0000000000000001 R15: 0000000000000001