hfs: continuing without an alternate MDB ============================================ WARNING: possible recursive locking detected syzkaller #0 Not tainted -------------------------------------------- syz.4.133/7602 is trying to acquire lock: ffff0000dccd00f8 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}, at: hfs_extend_file+0xd4/0xf4c fs/hfs/extent.c:397 but task is already holding lock: ffff0000dccd0778 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}, at: hfs_extend_file+0xd4/0xf4c fs/hfs/extent.c:397 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&HFS_I(tree->inode)->extents_lock); lock(&HFS_I(tree->inode)->extents_lock); *** DEADLOCK *** May be due to missing lock nesting notation 5 locks held by syz.4.133/7602: #0: ffff0000d275c428 (sb_writers#28){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:557 #1: ffff0000dccd0fa0 (&type->i_mutex_dir_key#20/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:914 [inline] #1: ffff0000dccd0fa0 (&type->i_mutex_dir_key#20/1){+.+.}-{4:4}, at: filename_create+0x1ac/0x32c fs/namei.c:4139 #2: ffff0000ce4c20b0 (&tree->tree_lock#2){+.+.}-{4:4}, at: hfs_find_init+0x15c/0x1d8 fs/hfs/bfind.c:-1 #3: ffff0000dccd0778 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}, at: hfs_extend_file+0xd4/0xf4c fs/hfs/extent.c:397 #4: ffff0000ce4c00b0 (&tree->tree_lock#2/1){+.+.}-{4:4}, at: hfs_find_init+0x15c/0x1d8 fs/hfs/bfind.c:-1 stack backtrace: CPU: 0 UID: 0 PID: 7602 Comm: syz.4.133 Not tainted syzkaller #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:499 (C) __dump_stack+0x30/0x40 lib/dump_stack.c:94 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 print_deadlock_bug+0x2e8/0x2f0 kernel/locking/lockdep.c:3041 check_deadlock kernel/locking/lockdep.c:3093 [inline] validate_chain kernel/locking/lockdep.c:3895 [inline] __lock_acquire+0x2940/0x30a4 kernel/locking/lockdep.c:5237 lock_acquire+0x14c/0x2e0 kernel/locking/lockdep.c:5868 __mutex_lock_common+0x1d0/0x2678 kernel/locking/mutex.c:598 __mutex_lock kernel/locking/mutex.c:760 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:812 hfs_extend_file+0xd4/0xf4c fs/hfs/extent.c:397 hfs_bmap_reserve+0xd4/0x3e0 fs/hfs/btree.c:269 __hfs_ext_write_extent+0x19c/0x488 fs/hfs/extent.c:121 __hfs_ext_cache_extent+0x84/0x750 fs/hfs/extent.c:174 hfs_ext_read_extent fs/hfs/extent.c:202 [inline] hfs_extend_file+0x264/0xf4c fs/hfs/extent.c:401 hfs_bmap_reserve+0xd4/0x3e0 fs/hfs/btree.c:269 hfs_cat_create+0x19c/0x590 fs/hfs/catalog.c:104 hfs_mkdir+0x6c/0xe4 fs/hfs/dir.c:232 vfs_mkdir+0x284/0x424 fs/namei.c:4366 do_mkdirat+0x1f8/0x4c8 fs/namei.c:4399 __do_sys_mkdirat fs/namei.c:4416 [inline] __se_sys_mkdirat fs/namei.c:4414 [inline] __arm64_sys_mkdirat+0x8c/0xa4 fs/namei.c:4414 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x5c/0x254 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:763 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 hfs: new node 0 already hashed? ------------[ cut here ]------------ WARNING: CPU: 1 PID: 7602 at fs/hfs/bnode.c:520 hfs_bnode_create+0x384/0x430 fs/hfs/bnode.c:519 Modules linked in: CPU: 1 UID: 0 PID: 7602 Comm: syz.4.133 Not tainted syzkaller #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025 pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--) pc : hfs_bnode_create+0x384/0x430 fs/hfs/bnode.c:519 lr : hfs_bnode_create+0x384/0x430 fs/hfs/bnode.c:519 sp : ffff8000a01172b0 x29: ffff8000a01172c0 x28: 0000000000000000 x27: dfff800000000000 x26: 0000000000000080 x25: dfff800000000000 x24: 0000000000000000 x23: ffff0000e2b2c08c x22: 0000000000000000 x21: 0000000000000000 x20: ffff0000ce4c0000 x19: ffff0000cb964900 x18: 1fffe0003379be88 x17: ffff80008f7de000 x16: ffff80008b0155d8 x15: 0000000000000001 x14: 1ffff00014022dcc x13: 0000000000000000 x12: 0000000000000000 x11: ffff700014022dcd x10: 0000000000ff0100 x9 : 13d5e546ec35d400 x8 : 13d5e546ec35d400 x7 : 0000000000000000 x6 : ffff800080490a90 x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff8000807de538 x2 : 0000000000000001 x1 : 0000000100000000 x0 : 000000000000001f Call trace: hfs_bnode_create+0x384/0x430 fs/hfs/bnode.c:519 (P) hfs_bmap_alloc+0x5b0/0x688 fs/hfs/btree.c:326 hfs_btree_inc_height+0xf8/0x870 fs/hfs/brec.c:471 hfs_brec_insert+0x5bc/0x96c fs/hfs/brec.c:148 __hfs_ext_write_extent+0x230/0x488 fs/hfs/extent.c:124 __hfs_ext_cache_extent+0x84/0x750 fs/hfs/extent.c:174 hfs_ext_read_extent fs/hfs/extent.c:202 [inline] hfs_extend_file+0x264/0xf4c fs/hfs/extent.c:401 hfs_bmap_reserve+0xd4/0x3e0 fs/hfs/btree.c:269 hfs_cat_create+0x19c/0x590 fs/hfs/catalog.c:104 hfs_mkdir+0x6c/0xe4 fs/hfs/dir.c:232 vfs_mkdir+0x284/0x424 fs/namei.c:4366 do_mkdirat+0x1f8/0x4c8 fs/namei.c:4399 __do_sys_mkdirat fs/namei.c:4416 [inline] __se_sys_mkdirat fs/namei.c:4414 [inline] __arm64_sys_mkdirat+0x8c/0xa4 fs/namei.c:4414 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x5c/0x254 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:763 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 irq event stamp: 1989 hardirqs last enabled at (1989): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline] hardirqs last enabled at (1989): [] _raw_spin_unlock_irqrestore+0x38/0x98 kernel/locking/spinlock.c:194 hardirqs last disabled at (1988): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (1988): [] _raw_spin_lock_irqsave+0x2c/0x7c kernel/locking/spinlock.c:162 softirqs last enabled at (1954): [] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32 softirqs last disabled at (1952): [] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19 ---[ end trace 0000000000000000 ]--- ------------[ cut here ]------------ kernel BUG at fs/hfs/bnode.c:565! Internal error: Oops - BUG: 00000000f2000800 [#1] SMP Modules linked in: CPU: 1 UID: 0 PID: 7602 Comm: syz.4.133 Tainted: G W syzkaller #0 PREEMPT Tainted: [W]=WARN Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025 pstate: 83400005 (Nzcv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--) pc : hfs_bnode_put+0x358/0x364 fs/hfs/bnode.c:565 lr : hfs_bnode_put+0x358/0x364 fs/hfs/bnode.c:565 sp : ffff8000a01173a0 x29: ffff8000a01173a0 x28: 0000000000000302 x27: dfff800000000000 x26: ffff700014022e88 x25: ffff8000a0117440 x24: 1fffe0001972c920 x23: ffff0000ce4c0000 x22: dfff800000000000 x21: 0000000000000000 x20: ffff0000cb964980 x19: ffff0000cb964900 x18: 1fffe0003379be88 x17: ffff80008f7de000 x16: ffff8000805353bc x15: 0000000000000001 x14: 1fffe0001972c930 x13: 0000000000000000 x12: 0000000000000000 x11: ffff60001972c931 x10: 0000000000ff0100 x9 : 0000000000000000 x8 : ffff0000c80cdb80 x7 : 0000000000000000 x6 : ffff80008af7fbc0 x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff80008130621c x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000000 Call trace: hfs_bnode_put+0x358/0x364 fs/hfs/bnode.c:565 (P) hfs_btree_inc_height+0x448/0x870 fs/hfs/brec.c:525 hfs_brec_insert+0x5bc/0x96c fs/hfs/brec.c:148 __hfs_ext_write_extent+0x230/0x488 fs/hfs/extent.c:124 __hfs_ext_cache_extent+0x84/0x750 fs/hfs/extent.c:174 hfs_ext_read_extent fs/hfs/extent.c:202 [inline] hfs_extend_file+0x264/0xf4c fs/hfs/extent.c:401 hfs_bmap_reserve+0xd4/0x3e0 fs/hfs/btree.c:269 hfs_cat_create+0x19c/0x590 fs/hfs/catalog.c:104 hfs_mkdir+0x6c/0xe4 fs/hfs/dir.c:232 vfs_mkdir+0x284/0x424 fs/namei.c:4366 do_mkdirat+0x1f8/0x4c8 fs/namei.c:4399 __do_sys_mkdirat fs/namei.c:4416 [inline] __se_sys_mkdirat fs/namei.c:4414 [inline] __arm64_sys_mkdirat+0x8c/0xa4 fs/namei.c:4414 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x5c/0x254 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:763 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 Code: aa1403e0 97e59f70 17ffffce 97d0a3ea (d4210000) ---[ end trace 0000000000000000 ]---