====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0 Not tainted ------------------------------------------------------ syz-executor.1/5229 is trying to acquire lock: ffff88801ac040b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfsplus_find_init+0x16e/0x200 fs/hfsplus/bfind.c:33 but task is already holding lock: ffff888040bb3708 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x204/0x9e0 fs/hfsplus/extents.c:576 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 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_ext_write_extent+0x474/0x5e0 fs/hfsplus/extents.c:104 hfsplus_ext_write_extent_locked fs/hfsplus/extents.c:139 [inline] hfsplus_ext_write_extent_locked fs/hfsplus/extents.c:129 [inline] hfsplus_ext_write_extent+0x1c9/0x210 fs/hfsplus/extents.c:150 hfsplus_write_inode+0x22/0x4f0 fs/hfsplus/super.c:154 write_inode fs/fs-writeback.c:1497 [inline] __writeback_single_inode+0xb36/0xf90 fs/fs-writeback.c:1716 writeback_single_inode+0x2b5/0x5a0 fs/fs-writeback.c:1772 sync_inode_metadata+0xa5/0xf0 fs/fs-writeback.c:2842 hfsplus_file_fsync+0x115/0x5d0 fs/hfsplus/inode.c:317 vfs_fsync_range+0x141/0x230 fs/sync.c:188 generic_write_sync include/linux/fs.h:2794 [inline] generic_file_write_iter+0x2ac/0x350 mm/filemap.c:4140 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x6b6/0x1140 fs/read_write.c:590 ksys_write+0x12f/0x260 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&tree->tree_lock/1){+.+.}-{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+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 hfsplus_find_init+0x16e/0x200 fs/hfsplus/bfind.c:33 hfsplus_file_truncate+0x2a8/0x9e0 fs/hfsplus/extents.c:582 hfsplus_delete_inode+0x18f/0x220 fs/hfsplus/inode.c:450 hfsplus_unlink+0x583/0x7f0 fs/hfsplus/dir.c:405 vfs_unlink+0x2fb/0x9b0 fs/namei.c:4343 do_unlinkat+0x5c0/0x750 fs/namei.c:4407 __do_sys_unlink fs/namei.c:4455 [inline] __se_sys_unlink fs/namei.c:4453 [inline] __x64_sys_unlink+0xc7/0x110 fs/namei.c:4453 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&HFSPLUS_I(inode)->extents_lock); lock(&tree->tree_lock/1); lock(&HFSPLUS_I(inode)->extents_lock); lock(&tree->tree_lock/1); *** DEADLOCK *** 5 locks held by syz-executor.1/5229: #0: ffff88801ac02420 (sb_writers#13){.+.+}-{0:0}, at: do_unlinkat+0x1d3/0x750 fs/namei.c:4390 #1: ffff888048a975c0 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:826 [inline] #1: ffff888048a975c0 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: do_unlinkat+0x288/0x750 fs/namei.c:4394 #2: ffff888040bb3900 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:791 [inline] #2: ffff888040bb3900 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: vfs_unlink+0xd3/0x9b0 fs/namei.c:4332 #3: ffff888047d72198 (&sbi->vh_mutex){+.+.}-{3:3}, at: hfsplus_unlink+0x184/0x7f0 fs/hfsplus/dir.c:370 #4: ffff888040bb3708 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x204/0x9e0 fs/hfsplus/extents.c:576 stack backtrace: CPU: 1 PID: 5229 Comm: syz-executor.1 Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #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+0x116/0x1f0 lib/dump_stack.c:114 check_noncircular+0x31a/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+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 hfsplus_find_init+0x16e/0x200 fs/hfsplus/bfind.c:33 hfsplus_file_truncate+0x2a8/0x9e0 fs/hfsplus/extents.c:582 hfsplus_delete_inode+0x18f/0x220 fs/hfsplus/inode.c:450 hfsplus_unlink+0x583/0x7f0 fs/hfsplus/dir.c:405 vfs_unlink+0x2fb/0x9b0 fs/namei.c:4343 do_unlinkat+0x5c0/0x750 fs/namei.c:4407 __do_sys_unlink fs/namei.c:4455 [inline] __se_sys_unlink fs/namei.c:4453 [inline] __x64_sys_unlink+0xc7/0x110 fs/namei.c:4453 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f124f87c697 Code: 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 57 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffd1d1f5368 EFLAGS: 00000206 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f124f87c697 RDX: 00007ffd1d1f5390 RSI: 00007ffd1d1f5420 RDI: 00007ffd1d1f5420 RBP: 00007ffd1d1f5420 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000206 R12: 00007ffd1d1f6510 R13: 00007f124f8c8336 R14: 000000000000edb6 R15: 000000000000000b