====================================================== WARNING: possible circular locking dependency detected 6.12.0-syzkaller-11677-g2ba9f676d0a2 #0 Not tainted ------------------------------------------------------ syz.1.818/9677 is trying to acquire lock: ffff88807d61a988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1c1/0x1090 fs/hfsplus/extents.c:458 but task is already holding lock: ffff88807a93c0b0 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfsplus_find_init+0x17b/0x1f0 fs/hfsplus/bfind.c:28 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&tree->tree_lock/1){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 hfsplus_find_init+0x17b/0x1f0 fs/hfsplus/bfind.c:28 hfsplus_file_truncate+0x2ab/0xb70 fs/hfsplus/extents.c:583 hfsplus_delete_inode+0x18f/0x220 fs/hfsplus/inode.c:449 hfsplus_unlink+0x583/0x7f0 fs/hfsplus/dir.c:405 vfs_unlink+0x2fe/0x9b0 fs/namei.c:4523 do_unlinkat+0x570/0x760 fs/namei.c:4587 __do_sys_unlink fs/namei.c:4635 [inline] __se_sys_unlink fs/namei.c:4633 [inline] __x64_sys_unlink+0xc5/0x110 fs/namei.c:4633 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 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5226 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 hfsplus_file_extend+0x1c1/0x1090 fs/hfsplus/extents.c:458 hfsplus_bmap_reserve+0x31c/0x410 fs/hfsplus/btree.c:358 __hfsplus_ext_write_extent+0x474/0x5e0 fs/hfsplus/extents.c:104 __hfsplus_ext_cache_extent+0x98/0x9d0 fs/hfsplus/extents.c:186 hfsplus_ext_read_extent+0x200/0x250 fs/hfsplus/extents.c:218 hfsplus_file_extend+0x699/0x1090 fs/hfsplus/extents.c:462 hfsplus_get_block+0x1ae/0x9e0 fs/hfsplus/extents.c:245 __block_write_begin_int+0x4fe/0x16e0 fs/buffer.c:2116 block_write_begin+0x9a/0x1d0 fs/buffer.c:2226 cont_write_begin+0x61d/0x950 fs/buffer.c:2577 hfsplus_write_begin+0x64/0x120 fs/hfsplus/inode.c:46 generic_perform_write+0x2bd/0x920 mm/filemap.c:4055 __generic_file_write_iter+0x1f7/0x240 mm/filemap.c:4156 generic_file_write_iter+0xe1/0x340 mm/filemap.c:4182 aio_write+0x3b5/0x8c0 fs/aio.c:1633 __io_submit_one fs/aio.c:2005 [inline] io_submit_one+0x1248/0x1da0 fs/aio.c:2052 __do_sys_io_submit fs/aio.c:2111 [inline] __se_sys_io_submit fs/aio.c:2081 [inline] __x64_sys_io_submit+0x1b2/0x340 fs/aio.c:2081 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(&tree->tree_lock/1); lock(&HFSPLUS_I(inode)->extents_lock); lock(&tree->tree_lock/1); lock(&HFSPLUS_I(inode)->extents_lock); *** DEADLOCK *** 3 locks held by syz.1.818/9677: #0: ffff88807d61d3f8 (&sb->s_type->i_mutex_key#32){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:818 [inline] #0: ffff88807d61d3f8 (&sb->s_type->i_mutex_key#32){+.+.}-{4:4}, at: generic_file_write_iter+0x8c/0x340 mm/filemap.c:4179 #1: ffff88807d61d208 (&hip->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1c1/0x1090 fs/hfsplus/extents.c:458 #2: ffff88807a93c0b0 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfsplus_find_init+0x17b/0x1f0 fs/hfsplus/bfind.c:28 stack backtrace: CPU: 1 UID: 0 PID: 9677 Comm: syz.1.818 Not tainted 6.12.0-syzkaller-11677-g2ba9f676d0a2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x419/0x5d0 kernel/locking/lockdep.c:2074 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5226 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 hfsplus_file_extend+0x1c1/0x1090 fs/hfsplus/extents.c:458 hfsplus_bmap_reserve+0x31c/0x410 fs/hfsplus/btree.c:358 __hfsplus_ext_write_extent+0x474/0x5e0 fs/hfsplus/extents.c:104 __hfsplus_ext_cache_extent+0x98/0x9d0 fs/hfsplus/extents.c:186 hfsplus_ext_read_extent+0x200/0x250 fs/hfsplus/extents.c:218 hfsplus_file_extend+0x699/0x1090 fs/hfsplus/extents.c:462 hfsplus_get_block+0x1ae/0x9e0 fs/hfsplus/extents.c:245 __block_write_begin_int+0x4fe/0x16e0 fs/buffer.c:2116 block_write_begin+0x9a/0x1d0 fs/buffer.c:2226 cont_write_begin+0x61d/0x950 fs/buffer.c:2577 hfsplus_write_begin+0x64/0x120 fs/hfsplus/inode.c:46 generic_perform_write+0x2bd/0x920 mm/filemap.c:4055 __generic_file_write_iter+0x1f7/0x240 mm/filemap.c:4156 generic_file_write_iter+0xe1/0x340 mm/filemap.c:4182 aio_write+0x3b5/0x8c0 fs/aio.c:1633 __io_submit_one fs/aio.c:2005 [inline] io_submit_one+0x1248/0x1da0 fs/aio.c:2052 __do_sys_io_submit fs/aio.c:2111 [inline] __se_sys_io_submit fs/aio.c:2081 [inline] __x64_sys_io_submit+0x1b2/0x340 fs/aio.c:2081 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:0x7f39d1780849 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f39d2548058 EFLAGS: 00000246 ORIG_RAX: 00000000000000d1 RAX: ffffffffffffffda RBX: 00007f39d1945fa0 RCX: 00007f39d1780849 RDX: 0000000020000540 RSI: 000000000000003b RDI: 00007f39d251f000 RBP: 00007f39d17f3986 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f39d1945fa0 R15: 00007ffc58fc9238