====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.1.854/8230 is trying to acquire lock: ffff888035cb93c0 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1c9/0x1270 fs/hfsplus/extents.c:457 but task is already holding lock: ffff8880346720a8 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfsplus_find_init+0x27c/0x410 fs/hfsplus/bfind.c:29 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&tree->tree_lock/1){+.+.}-{4:4}: lock_acquire kernel/locking/lockdep.c:5908 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5865 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x1a4/0x1bd0 kernel/locking/mutex.c:821 hfsplus_find_init+0x27c/0x410 fs/hfsplus/bfind.c:29 hfsplus_file_truncate+0x2cb/0xd60 fs/hfsplus/extents.c:585 hfsplus_delete_inode+0x194/0x230 fs/hfsplus/inode.c:553 hfsplus_file_release+0x1d2/0x230 fs/hfsplus/inode.c:301 __fput+0x3ff/0xb50 fs/file_table.c:512 task_work_run+0x150/0x240 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:70 [inline] exit_to_user_mode_loop+0x1d8/0x700 kernel/entry/common.c:101 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:336 [inline] do_syscall_64+0x661/0x790 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}: check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3181 check_prevs_add kernel/locking/lockdep.c:3300 [inline] validate_chain kernel/locking/lockdep.c:3924 [inline] __lock_acquire+0x1492/0x1ec0 kernel/locking/lockdep.c:5254 lock_acquire kernel/locking/lockdep.c:5908 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5865 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x1a4/0x1bd0 kernel/locking/mutex.c:821 hfsplus_file_extend+0x1c9/0x1270 fs/hfsplus/extents.c:457 hfsplus_bmap_reserve+0x36a/0x4b0 fs/hfsplus/btree.c:512 __hfsplus_ext_write_extent+0x537/0x6d0 fs/hfsplus/extents.c:104 __hfsplus_ext_cache_extent+0x98/0x9d0 fs/hfsplus/extents.c:190 hfsplus_ext_read_extent+0x200/0x250 fs/hfsplus/extents.c:222 hfsplus_file_extend+0x79a/0x1270 fs/hfsplus/extents.c:461 hfsplus_get_block+0x1a9/0xab0 fs/hfsplus/extents.c:249 get_more_blocks fs/direct-io.c:644 [inline] do_direct_IO fs/direct-io.c:932 [inline] __blockdev_direct_IO+0x195e/0x3380 fs/direct-io.c:1236 blockdev_direct_IO include/linux/fs.h:3155 [inline] hfsplus_direct_IO+0x1ce/0x4b0 fs/hfsplus/inode.c:174 generic_file_direct_write+0x198/0x410 mm/filemap.c:4308 __generic_file_write_iter+0x11b/0x240 mm/filemap.c:4477 generic_file_write_iter+0xe1/0x390 mm/filemap.c:4517 do_iter_readv_writev+0x6f7/0x930 fs/read_write.c:828 vfs_writev+0x360/0xdd0 fs/read_write.c:1058 do_pwritev+0x1ac/0x270 fs/read_write.c:1154 __do_sys_pwritev2 fs/read_write.c:1212 [inline] __se_sys_pwritev2 fs/read_write.c:1203 [inline] __x64_sys_pwritev2+0xef/0x160 fs/read_write.c:1203 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 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 *** locks held by syz.1.854/8230: 4, last CPU#1: #0: ffff8880531d0460 (sb_writers#17){.+.+}-{0:0}, at: do_pwritev+0x1ac/0x270 fs/read_write.c:1154 #1: ffff88803634c118 (&sb->s_type->i_mutex_key#28){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1024 [inline] #1: ffff88803634c118 (&sb->s_type->i_mutex_key#28){+.+.}-{4:4}, at: generic_file_write_iter+0x8c/0x390 mm/filemap.c:4514 #2: ffff88803634bf80 (&hip->extents_lock){+.+.}-{4:4}, at: hfsplus_file_extend+0x1c9/0x1270 fs/hfsplus/extents.c:457 #3: ffff8880346720a8 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfsplus_find_init+0x27c/0x410 fs/hfsplus/bfind.c:29 stack backtrace: CPU: 1 UID: 0 PID: 8230 Comm: syz.1.854 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/05/2026 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_circular_bug.cold+0x178/0x1be kernel/locking/lockdep.c:2059 check_noncircular+0x146/0x160 kernel/locking/lockdep.c:2191 check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3181 check_prevs_add kernel/locking/lockdep.c:3300 [inline] validate_chain kernel/locking/lockdep.c:3924 [inline] __lock_acquire+0x1492/0x1ec0 kernel/locking/lockdep.c:5254 lock_acquire kernel/locking/lockdep.c:5908 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5865 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x1a4/0x1bd0 kernel/locking/mutex.c:821 hfsplus_file_extend+0x1c9/0x1270 fs/hfsplus/extents.c:457 hfsplus_bmap_reserve+0x36a/0x4b0 fs/hfsplus/btree.c:512 __hfsplus_ext_write_extent+0x537/0x6d0 fs/hfsplus/extents.c:104 __hfsplus_ext_cache_extent+0x98/0x9d0 fs/hfsplus/extents.c:190 hfsplus_ext_read_extent+0x200/0x250 fs/hfsplus/extents.c:222 hfsplus_file_extend+0x79a/0x1270 fs/hfsplus/extents.c:461 hfsplus_get_block+0x1a9/0xab0 fs/hfsplus/extents.c:249 get_more_blocks fs/direct-io.c:644 [inline] do_direct_IO fs/direct-io.c:932 [inline] __blockdev_direct_IO+0x195e/0x3380 fs/direct-io.c:1236 blockdev_direct_IO include/linux/fs.h:3155 [inline] hfsplus_direct_IO+0x1ce/0x4b0 fs/hfsplus/inode.c:174 generic_file_direct_write+0x198/0x410 mm/filemap.c:4308 __generic_file_write_iter+0x11b/0x240 mm/filemap.c:4477 generic_file_write_iter+0xe1/0x390 mm/filemap.c:4517 do_iter_readv_writev+0x6f7/0x930 fs/read_write.c:828 vfs_writev+0x360/0xdd0 fs/read_write.c:1058 do_pwritev+0x1ac/0x270 fs/read_write.c:1154 __do_sys_pwritev2 fs/read_write.c:1212 [inline] __se_sys_pwritev2 fs/read_write.c:1203 [inline] __x64_sys_pwritev2+0xef/0x160 fs/read_write.c:1203 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f792c99e159 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f792abf6028 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 RAX: ffffffffffffffda RBX: 00007f792cc25fa0 RCX: 00007f792c99e159 RDX: 0000000000000001 RSI: 0000200000000240 RDI: 0000000000000004 RBP: 00007f792ca35024 R08: 0000000000000000 R09: 0000000000000003 R10: 0000000000002000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f792cc26038 R14: 00007f792cc25fa0 R15: 00007ffdf6e41fd8