============================================ WARNING: possible recursive locking detected 6.17.0-rc1-syzkaller-g8f5ae30d69d7 #0 Not tainted -------------------------------------------- syz.3.99/7254 is trying to acquire lock: ffff0000d7f200f8 (&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: ffff0000d7f20778 (&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.3.99/7254: #0: ffff0000d81ae428 (sb_writers#27){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:557 #1: ffff0000d7f20fa0 (&type->i_mutex_dir_key#19/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:914 [inline] #1: ffff0000d7f20fa0 (&type->i_mutex_dir_key#19/1){+.+.}-{4:4}, at: filename_create+0x1ac/0x32c fs/namei.c:4139 #2: ffff0000d896c0b0 (&tree->tree_lock#2){+.+.}-{4:4}, at: hfs_find_init+0x15c/0x1d8 fs/hfs/bfind.c:-1 #3: ffff0000d7f20778 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}, at: hfs_extend_file+0xd4/0xf4c fs/hfs/extent.c:397 #4: ffff0000d896e0b0 (&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: 7254 Comm: syz.3.99 Not tainted 6.17.0-rc1-syzkaller-g8f5ae30d69d7 #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/0x24ac 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+0x58/0x180 arch/arm64/kernel/entry-common.c:879 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 hfs: new node 0 already hashed? ------------[ cut here ]------------ WARNING: CPU: 0 PID: 7254 at fs/hfs/bnode.c:520 hfs_bnode_create+0x384/0x430 fs/hfs/bnode.c:519 Modules linked in: CPU: 0 UID: 0 PID: 7254 Comm: syz.3.99 Not tainted 6.17.0-rc1-syzkaller-g8f5ae30d69d7 #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 : ffff8000a4d072b0 x29: ffff8000a4d072c0 x28: 0000000000000000 x27: dfff800000000000 x26: 0000000000000080 x25: dfff800000000000 x24: 0000000000000000 x23: ffff00010e1e108c x22: 0000000000000000 x21: 0000000000000000 x20: ffff0000d896e000 x19: ffff0000d3c79100 x18: 1fffe0003379be88 x17: 0000000000000000 x16: ffff80008b007230 x15: 0000000000000001 x14: 1ffff000149a0dcc x13: 0000000000000000 x12: 0000000000000000 x11: ffff7000149a0dcd x10: 0000000000ff0100 x9 : 6adf4952688a4600 x8 : 6adf4952688a4600 x7 : 0000000000000001 x6 : ffff800080563af4 x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000807de560 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+0x58/0x180 arch/arm64/kernel/entry-common.c:879 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 irq event stamp: 7521 hardirqs last enabled at (7521): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline] hardirqs last enabled at (7521): [] _raw_spin_unlock_irqrestore+0x38/0x98 kernel/locking/spinlock.c:194 hardirqs last disabled at (7520): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (7520): [] _raw_spin_lock_irqsave+0x2c/0x7c kernel/locking/spinlock.c:162 softirqs last enabled at (7068): [] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32 softirqs last disabled at (7066): [] 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: 0 UID: 0 PID: 7254 Comm: syz.3.99 Tainted: G W 6.17.0-rc1-syzkaller-g8f5ae30d69d7 #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 : ffff8000a4d073a0 x29: ffff8000a4d073a0 x28: 0000000000000302 x27: dfff800000000000 x26: ffff7000149a0e88 x25: ffff8000a4d07440 x24: 1fffe0001a78f220 x23: ffff0000d896e000 x22: dfff800000000000 x21: 0000000000000000 x20: ffff0000d3c79180 x19: ffff0000d3c79100 x18: 1fffe0003379be88 x17: 0000000000000000 x16: ffff800080535980 x15: 0000000000000001 x14: 1fffe0001a78f230 x13: 0000000000000000 x12: 0000000000000000 x11: ffff60001a78f231 x10: 0000000000ff0100 x9 : 0000000000000000 x8 : ffff0000d04b3d00 x7 : 0000000000000000 x6 : ffff80008af730c0 x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff800081304d18 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+0x58/0x180 arch/arm64/kernel/entry-common.c:879 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 Code: aa1403e0 97e5a3bb 17ffffce 97d0a953 (d4210000) ---[ end trace 0000000000000000 ]---