loop2: detected capacity change from 0 to 64 hfs: unable to locate alternate MDB hfs: continuing without an alternate MDB ====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc5-syzkaller-00018-g55027e689933 #0 Not tainted ------------------------------------------------------ syz.2.575/7471 is trying to acquire lock: ffff8880231860b0 (&tree->tree_lock#2/1){+.+.}-{3:3}, at: hfs_find_init+0x16e/0x1f0 but task is already holding lock: ffff888062fba7f8 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}, at: hfs_get_block+0x26f/0xb60 fs/hfs/extent.c:365 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 hfs_extend_file+0xff/0x1450 fs/hfs/extent.c:397 hfs_bmap_reserve+0xd9/0x400 fs/hfs/btree.c:234 __hfs_ext_write_extent+0x22e/0x4f0 fs/hfs/extent.c:121 __hfs_ext_cache_extent+0x6a/0x990 fs/hfs/extent.c:174 hfs_ext_read_extent fs/hfs/extent.c:202 [inline] hfs_extend_file+0x344/0x1450 fs/hfs/extent.c:401 hfs_get_block+0x3e4/0xb60 fs/hfs/extent.c:353 __block_write_begin_int+0x50c/0x1a70 fs/buffer.c:2128 __block_write_begin fs/buffer.c:2177 [inline] block_write_begin+0x9b/0x1e0 fs/buffer.c:2236 cont_write_begin+0x645/0x890 fs/buffer.c:2590 hfs_write_begin+0x8a/0xd0 fs/hfs/inode.c:53 generic_perform_write+0x322/0x640 mm/filemap.c:4015 generic_file_write_iter+0xaf/0x310 mm/filemap.c:4136 new_sync_write fs/read_write.c:497 [inline] vfs_write+0xa72/0xc90 fs/read_write.c:590 ksys_write+0x1a0/0x2c0 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&tree->tree_lock#2/1){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 hfs_find_init+0x16e/0x1f0 hfs_ext_read_extent fs/hfs/extent.c:200 [inline] hfs_get_block+0x4f4/0xb60 fs/hfs/extent.c:366 block_read_full_folio+0x42e/0xe10 fs/buffer.c:2407 filemap_read_folio+0x1a0/0x790 mm/filemap.c:2355 do_read_cache_folio+0x134/0x820 mm/filemap.c:3788 do_read_cache_page+0x30/0x200 mm/filemap.c:3854 read_mapping_page include/linux/pagemap.h:900 [inline] hfs_btree_open+0x50b/0xf20 fs/hfs/btree.c:78 hfs_mdb_get+0x14c4/0x21b0 fs/hfs/mdb.c:204 hfs_fill_super+0x107e/0x1790 fs/hfs/super.c:406 mount_bdev+0x20a/0x2d0 fs/super.c:1659 legacy_get_tree+0xee/0x190 fs/fs_context.c:662 vfs_get_tree+0x90/0x2a0 fs/super.c:1780 do_new_mount+0x2be/0xb40 fs/namespace.c:3352 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 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(&HFS_I(tree->inode)->extents_lock); lock(&tree->tree_lock#2/1); lock(&HFS_I(tree->inode)->extents_lock ); lock(&tree->tree_lock#2/1); *** DEADLOCK *** 2 locks held by syz.2.575/7471: #0: ffff8880231840e0 (&type->s_umount_key#66/1){+.+.}-{3:3}, at: alloc_super+0x221/0x9d0 fs/super.c:344 #1: ffff888062fba7f8 (&HFS_I(tree->inode)->extents_lock ){+.+.}-{3:3}, at: hfs_get_block+0x26f/0xb60 fs/hfs/extent.c:365 stack backtrace: CPU: 1 PID: 7471 Comm: syz.2.575 Not tainted 6.10.0-rc5-syzkaller-00018-g55027e689933 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 check_noncircular+0x36a/0x4a0 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+0x18e0/0x5900 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 hfs_find_init+0x16e/0x1f0 hfs_ext_read_extent fs/hfs/extent.c:200 [inline] hfs_get_block+0x4f4/0xb60 fs/hfs/extent.c:366 block_read_full_folio+0x42e/0xe10 fs/buffer.c:2407 filemap_read_folio+0x1a0/0x790 mm/filemap.c:2355 do_read_cache_folio+0x134/0x820 mm/filemap.c:3788 do_read_cache_page+0x30/0x200 mm/filemap.c:3854 read_mapping_page include/linux/pagemap.h:900 [inline] hfs_btree_open+0x50b/0xf20 fs/hfs/btree.c:78 hfs_mdb_get+0x14c4/0x21b0 fs/hfs/mdb.c:204 hfs_fill_super+0x107e/0x1790 fs/hfs/super.c:406 mount_bdev+0x20a/0x2d0 fs/super.c:1659 legacy_get_tree+0xee/0x190 fs/fs_context.c:662 vfs_get_tree+0x90/0x2a0 fs/super.c:1780 do_new_mount+0x2be/0xb40 fs/namespace.c:3352 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f1308b7743a Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 7e 1a 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f13099f0e78 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f13099f0f00 RCX: 00007f1308b7743a RDX: 00000000200001c0 RSI: 0000000020000140 RDI: 00007f13099f0ec0 RBP: 00000000200001c0 R08: 00007f13099f0f00 R09: 0000000000014000 R10: 0000000000014000 R11: 0000000000000206 R12: 0000000020000140 R13: 00007f13099f0ec0 R14: 0000000000000293 R15: 0000000020000000 hfs: unable to open catalog tree hfs: can't find a HFS filesystem on dev loop2