loop2: detected capacity change from 0 to 64 ====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc5-syzkaller-00012-g626737a5791b #0 Not tainted ------------------------------------------------------ syz-executor.2/13126 is trying to acquire lock: ffff88802510e0b0 (&tree->tree_lock#2/1){+.+.}-{3:3}, at: hfs_find_init+0x183/0x220 fs/hfs/bfind.c:33 but task is already holding lock: ffff88806d97ef78 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}, at: hfs_get_block+0x553/0x830 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}: __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 hfs_extend_file+0xa2/0xb10 fs/hfs/extent.c:397 hfs_bmap_reserve+0x29c/0x380 fs/hfs/btree.c:234 __hfs_ext_write_extent+0x3cf/0x520 fs/hfs/extent.c:121 __hfs_ext_cache_extent fs/hfs/extent.c:174 [inline] hfs_ext_read_extent+0x809/0x9e0 fs/hfs/extent.c:202 hfs_extend_file+0x4e4/0xb10 fs/hfs/extent.c:401 hfs_get_block+0x17f/0x830 fs/hfs/extent.c:353 __block_write_begin_int+0x4fb/0x16e0 fs/buffer.c:2128 __block_write_begin fs/buffer.c:2177 [inline] block_write_begin+0xb1/0x4a0 fs/buffer.c:2236 cont_write_begin+0x53d/0x740 fs/buffer.c:2590 hfs_write_begin+0x87/0x150 fs/hfs/inode.c:53 cont_expand_zero fs/buffer.c:2517 [inline] cont_write_begin+0x333/0x740 fs/buffer.c:2580 hfs_write_begin+0x87/0x150 fs/hfs/inode.c:53 hfs_file_truncate+0xc11/0xfc0 fs/hfs/extent.c:494 hfs_inode_setattr+0x48f/0x5d0 fs/hfs/inode.c:652 notify_change+0x742/0x11f0 fs/attr.c:497 do_truncate+0x15c/0x220 fs/open.c:65 do_ftruncate+0x5e5/0x720 fs/open.c:181 __ia32_compat_sys_ftruncate+0x8a/0xe0 fs/open.c:211 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #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 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 hfs_find_init+0x183/0x220 fs/hfs/bfind.c:33 hfs_ext_read_extent+0x19c/0x9e0 fs/hfs/extent.c:200 hfs_get_block+0x55f/0x830 fs/hfs/extent.c:366 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_btree_open+0x662/0x1050 fs/hfs/btree.c:78 hfs_mdb_get+0x166e/0x2000 fs/hfs/mdb.c:204 hfs_fill_super+0xb1b/0x1860 fs/hfs/super.c:406 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+0x6e1/0x1f10 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] __ia32_sys_mount+0x295/0x320 fs/namespace.c:3875 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e 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-executor.2/13126: #0: ffff88801cd080e0 (&type->s_umount_key#96/1){+.+.}-{3:3}, at: alloc_super+0x23d/0xbd0 fs/super.c:344 #1: ffff88806d97ef78 (&HFS_I(tree->inode)->extents_lock){+.+.}-{3:3}, at: hfs_get_block+0x553/0x830 fs/hfs/extent.c:365 stack backtrace: CPU: 0 PID: 13126 Comm: syz-executor.2 Not tainted 6.10.0-rc5-syzkaller-00012-g626737a5791b #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 hfs_find_init+0x183/0x220 fs/hfs/bfind.c:33 hfs_ext_read_extent+0x19c/0x9e0 fs/hfs/extent.c:200 hfs_get_block+0x55f/0x830 fs/hfs/extent.c:366 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_btree_open+0x662/0x1050 fs/hfs/btree.c:78 hfs_mdb_get+0x166e/0x2000 fs/hfs/mdb.c:204 hfs_fill_super+0xb1b/0x1860 fs/hfs/super.c:406 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+0x6e1/0x1f10 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] __ia32_sys_mount+0x295/0x320 fs/namespace.c:3875 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf72ea579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f5edc400 EFLAGS: 00000292 ORIG_RAX: 0000000000000015 RAX: ffffffffffffffda RBX: 00000000f5edc460 RCX: 0000000020000280 RDX: 0000000020000240 RSI: 0000000000000000 RDI: 00000000f5edc4a0 RBP: 00000000f5edc460 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 hfs: unable to open catalog tree hfs: can't find a HFS filesystem on dev loop2 ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi