====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz-executor/4203 is trying to acquire lock: ffff8880209650f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_free+0xc1/0x4d0 fs/hfsplus/bitmap.c:182 but task is already holding lock: ffff88801b39e648 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2c6/0xb80 fs/hfsplus/extents.c:574 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}: __mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 hfsplus_get_block+0x3a1/0x15a0 fs/hfsplus/extents.c:260 block_read_full_page+0x306/0xd40 fs/buffer.c:2290 do_read_cache_page+0x8a1/0x1030 mm/filemap.c:-1 read_mapping_page include/linux/pagemap.h:515 [inline] hfsplus_block_allocate+0xf1/0x910 fs/hfsplus/bitmap.c:37 hfsplus_file_extend+0xb1f/0x1a50 fs/hfsplus/extents.c:466 hfsplus_get_block+0x430/0x15a0 fs/hfsplus/extents.c:245 __block_write_begin_int+0x565/0x15d0 fs/buffer.c:2012 __block_write_begin fs/buffer.c:2062 [inline] block_write_begin fs/buffer.c:2122 [inline] cont_write_begin+0x598/0x7b0 fs/buffer.c:2471 hfsplus_write_begin+0x92/0xe0 fs/hfsplus/inode.c:53 __page_symlink+0x102/0x200 fs/namei.c:5199 hfsplus_symlink+0xc6/0x260 fs/hfsplus/dir.c:449 vfs_symlink+0x247/0x3d0 fs/namei.c:4437 do_symlinkat+0x1ab/0x6b0 fs/namei.c:4466 __do_sys_symlink fs/namei.c:4488 [inline] __se_sys_symlink fs/namei.c:4486 [inline] __x64_sys_symlink+0x7a/0x90 fs/namei.c:4486 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (&sbi->alloc_mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 hfsplus_block_free+0xc1/0x4d0 fs/hfsplus/bitmap.c:182 hfsplus_free_extents+0x10d/0xa50 fs/hfsplus/extents.c:360 hfsplus_file_truncate+0x783/0xb80 fs/hfsplus/extents.c:589 hfsplus_delete_inode+0x17c/0x230 fs/hfsplus/inode.c:-1 hfsplus_unlink+0x4f7/0x7b0 fs/hfsplus/dir.c:405 vfs_unlink+0x385/0x600 fs/namei.c:4288 do_unlinkat+0x391/0x710 fs/namei.c:4356 __do_sys_unlink fs/namei.c:4404 [inline] __se_sys_unlink fs/namei.c:4402 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4402 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&HFSPLUS_I(inode)->extents_lock); lock(&sbi->alloc_mutex); lock(&HFSPLUS_I(inode)->extents_lock); lock(&sbi->alloc_mutex); *** DEADLOCK *** 5 locks held by syz-executor/4203: #0: ffff8880201c6460 (sb_writers#15){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:386 #1: ffff88807bdb5ac0 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:822 [inline] #1: ffff88807bdb5ac0 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: do_unlinkat+0x1c8/0x710 fs/namei.c:4339 #2: ffff88801b39e840 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #2: ffff88801b39e840 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: vfs_unlink+0xee/0x600 fs/namei.c:4277 #3: ffff888020965198 (&sbi->vh_mutex){+.+.}-{3:3}, at: hfsplus_unlink+0x175/0x7b0 fs/hfsplus/dir.c:370 #4: ffff88801b39e648 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2c6/0xb80 fs/hfsplus/extents.c:574 stack backtrace: CPU: 1 PID: 4203 Comm: syz-executor Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 hfsplus_block_free+0xc1/0x4d0 fs/hfsplus/bitmap.c:182 hfsplus_free_extents+0x10d/0xa50 fs/hfsplus/extents.c:360 hfsplus_file_truncate+0x783/0xb80 fs/hfsplus/extents.c:589 hfsplus_delete_inode+0x17c/0x230 fs/hfsplus/inode.c:-1 hfsplus_unlink+0x4f7/0x7b0 fs/hfsplus/dir.c:405 vfs_unlink+0x385/0x600 fs/namei.c:4288 do_unlinkat+0x391/0x710 fs/namei.c:4356 __do_sys_unlink fs/namei.c:4404 [inline] __se_sys_unlink fs/namei.c:4402 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4402 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f71dfbddec7 Code: 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 57 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007fff00f04af8 EFLAGS: 00000206 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f71dfbddec7 RDX: 00007fff00f04b20 RSI: 00007fff00f04bb0 RDI: 00007fff00f04bb0 RBP: 00007fff00f04bb0 R08: 00007fff00f05bb0 R09: 00000000ffffffff R10: 0000000000000100 R11: 0000000000000206 R12: 00007fff00f05ca0 R13: 00007f71dfc74120 R14: 000000000001544f R15: 00007fff00f06d70 hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent hfsplus: invalid extended attribute record hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent