============================================ WARNING: possible recursive locking detected syzkaller #0 Not tainted -------------------------------------------- syz.3.337/8679 is trying to acquire lock: ffff0000d6cd9478 (&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: ffff0000d6cd8778 (&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.337/8679: #0: ffff0000faa1c428 (sb_writers#18){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:557 #1: ffff0000d6cd82a0 (&type->i_mutex_dir_key#8){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] #1: ffff0000d6cd82a0 (&type->i_mutex_dir_key#8){++++}-{4:4}, at: open_last_lookups fs/namei.c:3804 [inline] #1: ffff0000d6cd82a0 (&type->i_mutex_dir_key#8){++++}-{4:4}, at: path_openat+0x638/0x2c40 fs/namei.c:4043 #2: ffff0000c7c5c0b0 (&tree->tree_lock){+.+.}-{4:4}, at: hfs_find_init+0x15c/0x1d8 fs/hfs/bfind.c:-1 #3: ffff0000d6cd8778 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}, at: hfs_extend_file+0xd4/0xf4c fs/hfs/extent.c:397 #4: ffff0000c7c5a0b0 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfs_find_init+0x15c/0x1d8 fs/hfs/bfind.c:-1 stack backtrace: CPU: 0 UID: 0 PID: 8679 Comm: syz.3.337 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_create+0x6c/0xe0 fs/hfs/dir.c:202 lookup_open fs/namei.c:3708 [inline] open_last_lookups fs/namei.c:3807 [inline] path_openat+0x12d8/0x2c40 fs/namei.c:4043 do_filp_open+0x18c/0x36c fs/namei.c:4073 do_sys_openat2+0x11c/0x1b4 fs/open.c:1435 do_sys_open fs/open.c:1450 [inline] __do_sys_openat fs/open.c:1466 [inline] __se_sys_openat fs/open.c:1461 [inline] __arm64_sys_openat+0x120/0x158 fs/open.c:1461 __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: 0 PID: 8679 at fs/hfs/bnode.c:520 hfs_bnode_create+0x384/0x430 fs/hfs/bnode.c:519 Modules linked in: CPU: 0 UID: 0 PID: 8679 Comm: syz.3.337 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 : ffff80009c106e90 x29: ffff80009c106ea0 x28: 0000000000000000 x27: dfff800000000000 x26: 0000000000000080 x25: dfff800000000000 x24: 0000000000000000 x23: ffff0000e307508c x22: 0000000000000000 x21: 0000000000000000 x20: ffff0000c7c5a000 x19: ffff0000cbe56900 x18: 1fffe00033797688 x17: ffff80008f7de000 x16: ffff80008b0155d8 x15: 0000000000000001 x14: 1ffff00013820d48 x13: 0000000000000000 x12: 0000000000000000 x11: ffff700013820d49 x10: 0000000000ff0100 x9 : d9ef1e8eaf903a00 x8 : d9ef1e8eaf903a00 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_create+0x6c/0xe0 fs/hfs/dir.c:202 lookup_open fs/namei.c:3708 [inline] open_last_lookups fs/namei.c:3807 [inline] path_openat+0x12d8/0x2c40 fs/namei.c:4043 do_filp_open+0x18c/0x36c fs/namei.c:4073 do_sys_openat2+0x11c/0x1b4 fs/open.c:1435 do_sys_open fs/open.c:1450 [inline] __do_sys_openat fs/open.c:1466 [inline] __se_sys_openat fs/open.c:1461 [inline] __arm64_sys_openat+0x120/0x158 fs/open.c:1461 __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: 729 hardirqs last enabled at (729): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline] hardirqs last enabled at (729): [] _raw_spin_unlock_irqrestore+0x38/0x98 kernel/locking/spinlock.c:194 hardirqs last disabled at (728): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (728): [] _raw_spin_lock_irqsave+0x2c/0x7c kernel/locking/spinlock.c:162 softirqs last enabled at (564): [] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32 softirqs last disabled at (562): [] 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: 8679 Comm: syz.3.337 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 : ffff80009c106f80 x29: ffff80009c106f80 x28: 0000000000000302 x27: dfff800000000000 x26: ffff700013820e04 x25: ffff80009c107020 x24: 1fffe000197cad20 x23: ffff0000c7c5a000 x22: dfff800000000000 x21: 0000000000000000 x20: ffff0000cbe56980 x19: ffff0000cbe56900 x18: 1fffe00033797688 x17: ffff80008f7de000 x16: ffff8000805353bc x15: 0000000000000001 x14: 1fffe000197cad30 x13: 0000000000000000 x12: 0000000000000000 x11: ffff6000197cad31 x10: 0000000000ff0100 x9 : 0000000000000000 x8 : ffff0000d02a8000 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_create+0x6c/0xe0 fs/hfs/dir.c:202 lookup_open fs/namei.c:3708 [inline] open_last_lookups fs/namei.c:3807 [inline] path_openat+0x12d8/0x2c40 fs/namei.c:4043 do_filp_open+0x18c/0x36c fs/namei.c:4073 do_sys_openat2+0x11c/0x1b4 fs/open.c:1435 do_sys_open fs/open.c:1450 [inline] __do_sys_openat fs/open.c:1466 [inline] __se_sys_openat fs/open.c:1461 [inline] __arm64_sys_openat+0x120/0x158 fs/open.c:1461 __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 ]---