bio_check_eod: 120 callbacks suppressed syz-executor: attempt to access beyond end of device loop3: rw=0, sector=201326592, nr_sectors = 2 limit=1024 buffer_io_error: 118 callbacks suppressed Buffer I/O error on dev loop3, logical block 100663296, async page read hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent ====================================================== WARNING: possible circular locking dependency detected 6.1.102-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor/3635 is trying to acquire lock: ffff88807cf080b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x80d/0xb40 fs/hfsplus/extents.c:595 but task is already holding lock: ffff88807c49d208 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2d6/0xb40 fs/hfsplus/extents.c:576 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747 hfsplus_file_extend+0x1d2/0x1b10 fs/hfsplus/extents.c:457 hfsplus_bmap_reserve+0x101/0x4e0 fs/hfsplus/btree.c:358 hfsplus_rename_cat+0x1cf/0x1090 fs/hfsplus/catalog.c:456 hfsplus_unlink+0x304/0x7f0 fs/hfsplus/dir.c:376 vfs_unlink+0x359/0x5f0 fs/namei.c:4324 do_unlinkat+0x4a5/0x820 fs/namei.c:4392 __do_sys_unlink fs/namei.c:4440 [inline] __se_sys_unlink fs/namei.c:4438 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4438 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&tree->tree_lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747 hfsplus_file_truncate+0x80d/0xb40 fs/hfsplus/extents.c:595 hfsplus_delete_inode+0x170/0x220 hfsplus_unlink+0x50d/0x7f0 fs/hfsplus/dir.c:405 vfs_unlink+0x359/0x5f0 fs/namei.c:4324 do_unlinkat+0x4a5/0x820 fs/namei.c:4392 __do_sys_unlink fs/namei.c:4440 [inline] __se_sys_unlink fs/namei.c:4438 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4438 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&HFSPLUS_I(inode)->extents_lock); lock(&tree->tree_lock); lock(&HFSPLUS_I(inode)->extents_lock); lock(&tree->tree_lock); *** DEADLOCK *** 5 locks held by syz-executor/3635: #0: ffff88807cf0a460 (sb_writers#14){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:393 #1: ffff88807c49e180 (&type->i_mutex_dir_key#9/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #1: ffff88807c49e180 (&type->i_mutex_dir_key#9/1){+.+.}-{3:3}, at: do_unlinkat+0x266/0x820 fs/namei.c:4375 #2: ffff88807c49d400 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #2: ffff88807c49d400 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: vfs_unlink+0xe0/0x5f0 fs/namei.c:4313 #3: ffff88801b7d7198 (&sbi->vh_mutex){+.+.}-{3:3}, at: hfsplus_unlink+0x15d/0x7f0 fs/hfsplus/dir.c:370 #4: ffff88807c49d208 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2d6/0xb40 fs/hfsplus/extents.c:576 stack backtrace: CPU: 1 PID: 3635 Comm: syz-executor Not tainted 6.1.102-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747 hfsplus_file_truncate+0x80d/0xb40 fs/hfsplus/extents.c:595 hfsplus_delete_inode+0x170/0x220 hfsplus_unlink+0x50d/0x7f0 fs/hfsplus/dir.c:405 vfs_unlink+0x359/0x5f0 fs/namei.c:4324 do_unlinkat+0x4a5/0x820 fs/namei.c:4392 __do_sys_unlink fs/namei.c:4440 [inline] __se_sys_unlink fs/namei.c:4438 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4438 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7ff11cb76fa7 Code: 73 01 c3 48 c7 c1 a8 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 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc9d314788 EFLAGS: 00000206 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff11cb76fa7 RDX: 00007ffc9d3147b0 RSI: 00007ffc9d314840 RDI: 00007ffc9d314840 RBP: 00007ffc9d314840 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000206 R12: 00007ffc9d315930 R13: 00007ff11cbe578c R14: 0000000000033b49 R15: 00007ffc9d317ae0 syz-executor: attempt to access beyond end of device loop3: rw=0, sector=201326592, nr_sectors = 2 limit=1024 Buffer I/O error on dev loop3, logical block 100663296, async page read hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent