====================================================== WARNING: possible circular locking dependency detected 6.3.0-rc2-syzkaller-00462-g5cdfdd6da323 #0 Not tainted ------------------------------------------------------ syz-executor329/5082 is trying to acquire lock: ffff88802c8407c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1d6/0x1b10 fs/hfsplus/extents.c:457 but task is already holding lock: ffff88807b6580b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_find_init+0x14a/0x1c0 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&tree->tree_lock){+.+.}-{3:3}: lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669 __mutex_lock_common+0x1d8/0x2530 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x1b/0x20 kernel/locking/mutex.c:799 hfsplus_file_truncate+0x811/0xb40 fs/hfsplus/extents.c:595 hfsplus_delete_inode+0x174/0x220 hfsplus_unlink+0x511/0x7f0 fs/hfsplus/dir.c:405 vfs_unlink+0x35d/0x5f0 fs/namei.c:4250 do_unlinkat+0x4a1/0x940 fs/namei.c:4316 __do_sys_unlinkat fs/namei.c:4359 [inline] __se_sys_unlinkat fs/namei.c:4352 [inline] __x64_sys_unlinkat+0xce/0xf0 fs/namei.c:4352 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain+0x166b/0x58e0 kernel/locking/lockdep.c:3832 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056 lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669 __mutex_lock_common+0x1d8/0x2530 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x1b/0x20 kernel/locking/mutex.c:799 hfsplus_file_extend+0x1d6/0x1b10 fs/hfsplus/extents.c:457 hfsplus_bmap_reserve+0x105/0x4e0 fs/hfsplus/btree.c:358 hfsplus_rename_cat+0x1d3/0x1090 fs/hfsplus/catalog.c:456 hfsplus_unlink+0x308/0x7f0 fs/hfsplus/dir.c:376 vfs_unlink+0x35d/0x5f0 fs/namei.c:4250 do_unlinkat+0x4a1/0x940 fs/namei.c:4316 do_coredump+0x2148/0x2980 fs/coredump.c:673 get_signal+0x145e/0x17e0 kernel/signal.c:2845 arch_do_signal_or_restart+0x91/0x670 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:203 irqentry_exit_to_user_mode+0x9/0x40 kernel/entry/common.c:309 exc_page_fault+0x4fc/0x7c0 arch/x86/mm/fault.c:1557 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-executor329/5082: #0: ffff888028ab2460 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:394 #1: ffff88802c841e00 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #1: ffff88802c841e00 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: do_unlinkat+0x264/0x940 fs/namei.c:4301 #2: ffff88802c844d40 (&sb->s_type->i_mutex_key#16){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #2: ffff88802c844d40 (&sb->s_type->i_mutex_key#16){+.+.}-{3:3}, at: vfs_unlink+0xe4/0x5f0 fs/namei.c:4239 #3: ffff888076587998 (&sbi->vh_mutex){+.+.}-{3:3}, at: hfsplus_unlink+0x161/0x7f0 fs/hfsplus/dir.c:370 #4: ffff88807b6580b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_find_init+0x14a/0x1c0 stack backtrace: CPU: 0 PID: 5082 Comm: syz-executor329 Not tainted 6.3.0-rc2-syzkaller-00462-g5cdfdd6da323 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2fe/0x3b0 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain+0x166b/0x58e0 kernel/locking/lockdep.c:3832 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056 lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669 __mutex_lock_common+0x1d8/0x2530 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x1b/0x20 kernel/locking/mutex.c:799 hfsplus_file_extend+0x1d6/0x1b10 fs/hfsplus/extents.c:457 hfsplus_bmap_reserve+0x105/0x4e0 fs/hfsplus/btree.c:358 hfsplus_rename_cat+0x1d3/0x1090 fs/hfsplus/catalog.c:456 hfsplus_unlink+0x308/0x7f0 fs/hfsplus/dir.c:376 vfs_unlink+0x35d/0x5f0 fs/namei.c:4250 do_unlinkat+0x4a1/0x940 fs/namei.c:4316 do_coredump+0x2148/0x2980 fs/coredump.c:673 get_signal+0x145e/0x17e0 kernel/signal.c:2845 arch_do_signal_or_restart+0x91/0x670 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:203 irqentry_exit_to_user_mode+0x9/0x40 kernel/entry/common.c:309 exc_page_fault+0x4fc/0x7c0 arch/x86/mm/fault.c:1557 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: 000000000000001a RCX: 00007fc4e52b3f49 RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000080 RBP: 00007ffea8028eb8 R08: 0000000000000000 R09: 00007fc4e5322e40 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffea8028ec0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000