hfsplus: invalid extended attribute record ============================================ WARNING: possible recursive locking detected syzkaller #0 Not tainted -------------------------------------------- syz.3.104/7165 is trying to acquire lock: ffff0000c9fecb48 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_get_block+0x2d4/0x1244 fs/hfsplus/extents.c:260 but task is already holding lock: ffff0000c9fee648 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_truncate+0x21c/0xa40 fs/hfsplus/extents.c:573 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 7 locks held by syz.3.104/7165: #0: ffff0001025ec420 (sb_writers#21){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:499 #1: ffff0000c9fed3f8 (&type->i_mutex_dir_key#14/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1025 [inline] #1: ffff0000c9fed3f8 (&type->i_mutex_dir_key#14/1){+.+.}-{4:4}, at: lock_rename fs/namei.c:3360 [inline] #1: ffff0000c9fed3f8 (&type->i_mutex_dir_key#14/1){+.+.}-{4:4}, at: do_renameat2+0x364/0x8a0 fs/namei.c:5311 #2: ffff0000c9fee178 (&sb->s_type->i_mutex_key#26){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:980 [inline] #2: ffff0000c9fee178 (&sb->s_type->i_mutex_key#26){+.+.}-{4:4}, at: lock_two_nondirectories+0xc4/0x150 fs/inode.c:1232 #3: ffff0000c9fee838 (&sb->s_type->i_mutex_key#26/4){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1025 [inline] #3: ffff0000c9fee838 (&sb->s_type->i_mutex_key#26/4){+.+.}-{4:4}, at: lock_two_nondirectories+0xf0/0x150 fs/inode.c:1234 #4: ffff0000d5a39998 (&sbi->vh_mutex){+.+.}-{4:4}, at: hfsplus_unlink+0x140/0x63c fs/hfsplus/dir.c:370 #5: ffff0000c9fee648 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfsplus_file_truncate+0x21c/0xa40 fs/hfsplus/extents.c:573 #6: ffff0000d5a398f8 (&sbi->alloc_mutex){+.+.}-{4:4}, at: hfsplus_block_free+0xc0/0x48c fs/hfsplus/bitmap.c:182 stack backtrace: CPU: 1 UID: 0 PID: 7165 Comm: syz.3.104 Not tainted syzkaller #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/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 hfsplus_get_block+0x2d4/0x1244 fs/hfsplus/extents.c:260 block_read_full_folio+0x2ec/0x824 fs/buffer.c:2420 hfsplus_read_folio+0x28/0x38 fs/hfsplus/inode.c:28 filemap_read_folio+0xec/0x2f8 mm/filemap.c:2444 do_read_cache_folio+0x364/0x5bc mm/filemap.c:4036 do_read_cache_page mm/filemap.c:4102 [inline] read_cache_page+0x6c/0x160 mm/filemap.c:4111 read_mapping_page include/linux/pagemap.h:993 [inline] hfsplus_block_free+0x114/0x48c fs/hfsplus/bitmap.c:185 hfsplus_free_extents+0x108/0x890 fs/hfsplus/extents.c:360 hfsplus_file_truncate+0x5d8/0xa40 fs/hfsplus/extents.c:588 hfsplus_delete_inode+0x164/0x210 fs/hfsplus/inode.c:-1 hfsplus_unlink+0x404/0x63c fs/hfsplus/dir.c:405 hfsplus_rename+0xd0/0x1b0 fs/hfsplus/dir.c:547 vfs_rename+0x9c0/0xc94 fs/namei.c:5216 do_renameat2+0x5ec/0x8a0 fs/namei.c:5364 __do_sys_renameat2 fs/namei.c:5398 [inline] __se_sys_renameat2 fs/namei.c:5395 [inline] __arm64_sys_renameat2+0xd8/0xf4 fs/namei.c:5395 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x254 arch/arm64/kernel/syscall.c:49 el0_svc_common+0xe8/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:724 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:743 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent: start 134, count 1