hfsplus: invalid extended attribute record ============================================ WARNING: possible recursive locking detected 5.15.179-syzkaller #0 Not tainted -------------------------------------------- syz.2.356/5747 is trying to acquire lock: ffff888023be4b48 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_get_block+0x37f/0x14e0 fs/hfsplus/extents.c:260 but task is already holding lock: ffff888023be5208 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x30f/0xc70 fs/hfsplus/extents.c:577 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&HFSPLUS_I(inode)->extents_lock); lock(&HFSPLUS_I(inode)->extents_lock); *** DEADLOCK *** May be due to missing lock nesting notation 3 locks held by syz.2.356/5747: #0: ffff888023be5400 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #0: ffff888023be5400 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: hfsplus_file_release+0xeb/0x3e0 fs/hfsplus/inode.c:235 #1: ffff888023be5208 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x30f/0xc70 fs/hfsplus/extents.c:577 #2: ffff88807c64b8f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_free+0xb7/0x4f0 fs/hfsplus/bitmap.c:182 stack backtrace: CPU: 0 PID: 5747 Comm: syz.2.356 Not tainted 5.15.179-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:2946 [inline] check_deadlock kernel/locking/lockdep.c:2989 [inline] validate_chain+0x46d2/0x5930 kernel/locking/lockdep.c:3775 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1da/0x25a0 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+0x37f/0x14e0 fs/hfsplus/extents.c:260 block_read_full_page+0x2f9/0xde0 fs/buffer.c:2290 do_read_cache_page+0x752/0x1040 read_mapping_page include/linux/pagemap.h:515 [inline] hfsplus_block_free+0x120/0x4f0 fs/hfsplus/bitmap.c:185 hfsplus_free_extents+0x17a/0xae0 fs/hfsplus/extents.c:363 hfsplus_file_truncate+0x871/0xc70 fs/hfsplus/extents.c:592 hfsplus_file_release+0x301/0x3e0 fs/hfsplus/inode.c:240 __fput+0x3fe/0x8e0 fs/file_table.c:311 task_work_run+0x129/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f20ea58c169 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007fffe9d15e28 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 000000000003771c RCX: 00007f20ea58c169 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 00007f20ea7a6ba0 R08: 0000000000000001 R09: 00000003e9d1611f R10: 00007f20ea3ff000 R11: 0000000000000246 R12: 00007f20ea7a508c R13: 00007f20ea7a5080 R14: ffffffffffffffff R15: 00007fffe9d15f40 hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent