====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc5-syzkaller-00018-g55027e689933 #0 Not tainted ------------------------------------------------------ syz-executor.1/21581 is trying to acquire lock: ffff888026198e88 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_get_block+0x277/0x9e0 fs/hfsplus/extents.c:260 but task is already holding lock: ffff8880251d20b0 (&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/0x9c0 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/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 -> #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+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_get_block+0x277/0x9e0 fs/hfsplus/extents.c:260 block_read_full_folio+0x38f/0xa70 fs/buffer.c:2407 filemap_read_folio+0xe5/0x2c0 mm/filemap.c:2355 do_read_cache_folio+0x203/0x540 mm/filemap.c:3788 do_read_cache_page mm/filemap.c:3854 [inline] read_cache_page+0x5b/0x160 mm/filemap.c:3863 read_mapping_page include/linux/pagemap.h:900 [inline] __hfs_bnode_create+0x63e/0x870 fs/hfsplus/bnode.c:440 hfsplus_bnode_create+0x187/0x530 fs/hfsplus/bnode.c:576 hfsplus_bmap_alloc+0x72c/0x830 fs/hfsplus/btree.c:415 hfs_btree_inc_height.isra.0+0x100/0x8c0 fs/hfsplus/brec.c:475 hfsplus_brec_insert+0x8e9/0xc50 fs/hfsplus/brec.c:148 hfsplus_create_cat+0x511/0x10d0 fs/hfsplus/catalog.c:292 hfsplus_fill_super+0x16ce/0x1bc0 fs/hfsplus/super.c:566 mount_bdev+0x1e3/0x2d0 fs/super.c:1659 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1780 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __x64_sys_mount+0x297/0x320 fs/namespace.c:3875 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); lock(&HFSPLUS_I(inode)->extents_lock); lock(&tree->tree_lock); lock(&HFSPLUS_I(inode)->extents_lock); *** DEADLOCK *** 3 locks held by syz-executor.1/21581: #0: ffff88802fcb20e0 (&type->s_umount_key#92/1){+.+.}-{3:3}, at: alloc_super+0x23d/0xbd0 fs/super.c:344 #1: ffff8880526ec998 (&sbi->vh_mutex){+.+.}-{3:3}, at: hfsplus_fill_super+0x1657/0x1bc0 fs/hfsplus/super.c:559 #2: ffff8880251d20b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_find_init+0x1a7/0x200 fs/hfsplus/bfind.c:30 stack backtrace: CPU: 2 PID: 21581 Comm: syz-executor.1 Not tainted 6.10.0-rc5-syzkaller-00018-g55027e689933 #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_get_block+0x277/0x9e0 fs/hfsplus/extents.c:260 block_read_full_folio+0x38f/0xa70 fs/buffer.c:2407 filemap_read_folio+0xe5/0x2c0 mm/filemap.c:2355 do_read_cache_folio+0x203/0x540 mm/filemap.c:3788 do_read_cache_page mm/filemap.c:3854 [inline] read_cache_page+0x5b/0x160 mm/filemap.c:3863 read_mapping_page include/linux/pagemap.h:900 [inline] __hfs_bnode_create+0x63e/0x870 fs/hfsplus/bnode.c:440 hfsplus_bnode_create+0x187/0x530 fs/hfsplus/bnode.c:576 hfsplus_bmap_alloc+0x72c/0x830 fs/hfsplus/btree.c:415 hfs_btree_inc_height.isra.0+0x100/0x8c0 fs/hfsplus/brec.c:475 hfsplus_brec_insert+0x8e9/0xc50 fs/hfsplus/brec.c:148 hfsplus_create_cat+0x511/0x10d0 fs/hfsplus/catalog.c:292 hfsplus_fill_super+0x16ce/0x1bc0 fs/hfsplus/super.c:566 mount_bdev+0x1e3/0x2d0 fs/super.c:1659 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1780 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __x64_sys_mount+0x297/0x320 fs/namespace.c:3875 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:0x7f679b27e5ea Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 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:00007f679bfefef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f679bfeff80 RCX: 00007f679b27e5ea RDX: 0000000020000000 RSI: 00000000200001c0 RDI: 00007f679bfeff40 RBP: 0000000020000000 R08: 00007f679bfeff80 R09: 0000000000200000 R10: 0000000000200000 R11: 0000000000000202 R12: 00000000200001c0 R13: 00007f679bfeff40 R14: 000000000000069b R15: 0000000020001940