====================================================== WARNING: possible circular locking dependency detected 6.17.0-rc1-syzkaller-g8f5ae30d69d7 #0 Not tainted ------------------------------------------------------ kworker/u8:0/12 is trying to acquire lock: ffff0000c6581af8 (&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: ffff000100e7a0b0 (&tree->tree_lock#2/1){+.+.}-{4:4}, at: hfs_find_init+0x15c/0x1d8 fs/hfs/bfind.c:-1 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&tree->tree_lock#2/1){+.+.}-{4:4}: __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_find_init+0x15c/0x1d8 fs/hfs/bfind.c:-1 hfs_ext_read_extent fs/hfs/extent.c:200 [inline] hfs_extend_file+0x238/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+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 -> #0 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x1774/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_write_extent+0x144/0x1bc fs/hfs/extent.c:144 hfs_write_inode+0xbc/0x704 fs/hfs/inode.c:429 write_inode fs/fs-writeback.c:1525 [inline] __writeback_single_inode+0x5ac/0x13e8 fs/fs-writeback.c:1745 writeback_sb_inodes+0x55c/0xe40 fs/fs-writeback.c:1976 wb_writeback+0x3cc/0xd70 fs/fs-writeback.c:2156 wb_do_writeback fs/fs-writeback.c:2303 [inline] wb_workfn+0x338/0xdc0 fs/fs-writeback.c:2343 process_one_work+0x7e8/0x155c kernel/workqueue.c:3236 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x958/0xed8 kernel/workqueue.c:3400 kthread+0x5fc/0x75c kernel/kthread.c:463 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:844 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&tree->tree_lock#2/1); lock(&HFS_I(tree->inode)->extents_lock); lock(&tree->tree_lock#2/1); lock(&HFS_I(tree->inode)->extents_lock); *** DEADLOCK *** 3 locks held by kworker/u8:0/12: #0: ffff0000c1f72948 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x63c/0x155c kernel/workqueue.c:3210 #1: ffff800097c17bc0 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x6d4/0x155c kernel/workqueue.c:3210 #2: ffff000100e7a0b0 (&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: 12 Comm: kworker/u8:0 Not tainted 6.17.0-rc1-syzkaller-g8f5ae30d69d7 #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025 Workqueue: writeback wb_workfn (flush-7:5) 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_circular_bug+0x324/0x32c kernel/locking/lockdep.c:2043 check_noncircular+0x154/0x174 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x1774/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_write_extent+0x144/0x1bc fs/hfs/extent.c:144 hfs_write_inode+0xbc/0x704 fs/hfs/inode.c:429 write_inode fs/fs-writeback.c:1525 [inline] __writeback_single_inode+0x5ac/0x13e8 fs/fs-writeback.c:1745 writeback_sb_inodes+0x55c/0xe40 fs/fs-writeback.c:1976 wb_writeback+0x3cc/0xd70 fs/fs-writeback.c:2156 wb_do_writeback fs/fs-writeback.c:2303 [inline] wb_workfn+0x338/0xdc0 fs/fs-writeback.c:2343 process_one_work+0x7e8/0x155c kernel/workqueue.c:3236 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x958/0xed8 kernel/workqueue.c:3400 kthread+0x5fc/0x75c kernel/kthread.c:463 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:844 hfs: new node 0 already hashed? ------------[ cut here ]------------ WARNING: CPU: 1 PID: 12 at fs/hfs/bnode.c:520 hfs_bnode_create+0x384/0x430 fs/hfs/bnode.c:519 Modules linked in: CPU: 1 UID: 0 PID: 12 Comm: kworker/u8:0 Not tainted 6.17.0-rc1-syzkaller-g8f5ae30d69d7 #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025 Workqueue: writeback wb_workfn (flush-7:5) 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 : ffff800097c16c10 x29: ffff800097c16c20 x28: 0000000000000000 x27: dfff800000000000 x26: 0000000000000080 x25: dfff800000000000 x24: 0000000000000000 x23: ffff0000fb05908c x22: 0000000000000000 x21: 0000000000000000 x20: ffff000100e7a000 x19: ffff0000d1d85400 x18: 1fffe000337a0688 x17: ffff80008f7be000 x16: ffff80008b007230 x15: 0000000000000001 x14: 1fffe000337a3108 x13: 0000000000000000 x12: 0000000000000000 x11: ffff6000337a3109 x10: 0000000000ff0100 x9 : 907e6282584c8600 x8 : 907e6282584c8600 x7 : 0000000000000000 x6 : ffff800080491074 x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000010 x2 : 0000000000000002 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_write_extent+0x144/0x1bc fs/hfs/extent.c:144 hfs_write_inode+0xbc/0x704 fs/hfs/inode.c:429 write_inode fs/fs-writeback.c:1525 [inline] __writeback_single_inode+0x5ac/0x13e8 fs/fs-writeback.c:1745 writeback_sb_inodes+0x55c/0xe40 fs/fs-writeback.c:1976 wb_writeback+0x3cc/0xd70 fs/fs-writeback.c:2156 wb_do_writeback fs/fs-writeback.c:2303 [inline] wb_workfn+0x338/0xdc0 fs/fs-writeback.c:2343 process_one_work+0x7e8/0x155c kernel/workqueue.c:3236 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x958/0xed8 kernel/workqueue.c:3400 kthread+0x5fc/0x75c kernel/kthread.c:463 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:844 irq event stamp: 1541371 hardirqs last enabled at (1541371): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline] hardirqs last enabled at (1541371): [] _raw_spin_unlock_irqrestore+0x38/0x98 kernel/locking/spinlock.c:194 hardirqs last disabled at (1541370): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (1541370): [] _raw_spin_lock_irqsave+0x2c/0x7c kernel/locking/spinlock.c:162 softirqs last enabled at (1540902): [] spin_unlock_bh include/linux/spinlock.h:396 [inline] softirqs last enabled at (1540902): [] batadv_nc_purge_paths+0x2f4/0x37c net/batman-adv/network-coding.c:471 softirqs last disabled at (1540900): [] spin_lock_bh include/linux/spinlock.h:356 [inline] softirqs last disabled at (1540900): [] batadv_nc_purge_paths+0xd0/0x37c net/batman-adv/network-coding.c:442 ---[ 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: 12 Comm: kworker/u8:0 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 Workqueue: writeback wb_workfn (flush-7:5) 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 : ffff800097c16d00 x29: ffff800097c16d00 x28: 0000000000000302 x27: dfff800000000000 x26: ffff700012f82db4 x25: ffff800097c16da0 x24: 1fffe0001a3b0a80 x23: ffff000100e7a000 x22: dfff800000000000 x21: 0000000000000000 x20: ffff0000d1d85480 x19: ffff0000d1d85400 x18: 1fffe000337a0688 x17: ffff80008f7be000 x16: ffff800080535980 x15: 0000000000000001 x14: 1fffe0001a3b0a90 x13: 0000000000000000 x12: 0000000000000000 x11: ffff60001a3b0a91 x10: 0000000000ff0100 x9 : 0000000000000000 x8 : ffff0000c19fdb80 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_write_extent+0x144/0x1bc fs/hfs/extent.c:144 hfs_write_inode+0xbc/0x704 fs/hfs/inode.c:429 write_inode fs/fs-writeback.c:1525 [inline] __writeback_single_inode+0x5ac/0x13e8 fs/fs-writeback.c:1745 writeback_sb_inodes+0x55c/0xe40 fs/fs-writeback.c:1976 wb_writeback+0x3cc/0xd70 fs/fs-writeback.c:2156 wb_do_writeback fs/fs-writeback.c:2303 [inline] wb_workfn+0x338/0xdc0 fs/fs-writeback.c:2343 process_one_work+0x7e8/0x155c kernel/workqueue.c:3236 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x958/0xed8 kernel/workqueue.c:3400 kthread+0x5fc/0x75c kernel/kthread.c:463 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:844 Code: aa1403e0 97e5a3bb 17ffffce 97d0a953 (d4210000) ---[ end trace 0000000000000000 ]---