loop1: detected capacity change from 0 to 1024 ====================================================== WARNING: possible circular locking dependency detected 6.9.0-rc5-syzkaller-00329-g5d12ed4bea43 #0 Not tainted ------------------------------------------------------ syz-executor.1/7341 is trying to acquire lock: ffff88806988a0b0 (&tree->tree_lock#2/2){+.+.}-{3:3}, at: hfsplus_find_init+0x14a/0x1c0 but task is already holding lock: ffff8880698880b0 (&tree->tree_lock#2){+.+.}-{3:3}, at: hfsplus_find_init+0x14a/0x1c0 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&tree->tree_lock#2){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 hfsplus_file_truncate+0x811/0xb50 fs/hfsplus/extents.c:595 hfsplus_setattr+0x1ce/0x280 fs/hfsplus/inode.c:265 notify_change+0xb9f/0xe70 fs/attr.c:497 do_truncate+0x220/0x310 fs/open.c:65 vfs_truncate+0x2e1/0x3b0 fs/open.c:111 do_sys_truncate+0xde/0x190 fs/open.c:134 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 hfsplus_get_block+0x383/0x14f0 fs/hfsplus/extents.c:260 block_read_full_folio+0x430/0xe10 fs/buffer.c:2384 filemap_read_folio+0x1a2/0x790 mm/filemap.c:2331 do_read_cache_folio+0x134/0x820 mm/filemap.c:3747 do_read_cache_page+0x30/0x200 mm/filemap.c:3813 read_mapping_page include/linux/pagemap.h:888 [inline] __hfs_bnode_create+0x487/0x770 fs/hfsplus/bnode.c:440 hfsplus_bnode_find+0x237/0x10c0 fs/hfsplus/bnode.c:486 hfsplus_brec_find+0x183/0x570 fs/hfsplus/bfind.c:183 __hfsplus_getxattr+0x364/0xb10 fs/hfsplus/xattr.c:522 hfsplus_getxattr+0x9c/0xd0 fs/hfsplus/xattr.c:590 vfs_getxattr_alloc+0x474/0x5c0 fs/xattr.c:393 ima_read_xattr+0x38/0x60 security/integrity/ima/ima_appraise.c:229 process_measurement+0x11d5/0x1f60 security/integrity/ima/ima_main.c:340 ima_file_check+0xf2/0x170 security/integrity/ima/ima_main.c:559 security_file_post_open+0x6f/0xa0 security/security.c:2981 do_open fs/namei.c:3644 [inline] path_openat+0x28b7/0x3240 fs/namei.c:3799 do_filp_open+0x235/0x490 fs/namei.c:3826 do_sys_openat2+0x13e/0x1d0 fs/open.c:1406 do_sys_open fs/open.c:1421 [inline] __do_sys_openat fs/open.c:1437 [inline] __se_sys_openat fs/open.c:1432 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1432 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&tree->tree_lock#2/2){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 hfsplus_find_init+0x14a/0x1c0 hfsplus_delete_attr+0x104/0x4b0 fs/hfsplus/attributes.c:321 hfsplus_removexattr fs/hfsplus/xattr.c:794 [inline] __hfsplus_setxattr+0x801/0x22d0 fs/hfsplus/xattr.c:275 hfsplus_setxattr+0xb0/0xe0 fs/hfsplus/xattr.c:434 hfsplus_security_setxattr+0x40/0x60 fs/hfsplus/xattr_security.c:31 __vfs_removexattr+0x42c/0x460 fs/xattr.c:518 __vfs_removexattr_locked+0x206/0x410 fs/xattr.c:553 vfs_removexattr+0x103/0x2b0 fs/xattr.c:575 removexattr+0x147/0x1c0 fs/xattr.c:917 path_removexattr+0x1a9/0x290 fs/xattr.c:931 __do_sys_removexattr fs/xattr.c:945 [inline] __se_sys_removexattr fs/xattr.c:942 [inline] __x64_sys_removexattr+0x60/0x70 fs/xattr.c:942 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &tree->tree_lock#2/2 --> &HFSPLUS_I(inode)->extents_lock --> &tree->tree_lock#2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&tree->tree_lock#2); lock(&HFSPLUS_I(inode)->extents_lock); lock(&tree->tree_lock#2); lock(&tree->tree_lock#2/2); *** DEADLOCK *** 3 locks held by syz-executor.1/7341: #0: ffff8880608fe420 (sb_writers#21){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:409 #1: ffff88802b883240 (&type->i_mutex_dir_key#19){++++}-{3:3}, at: inode_lock include/linux/fs.h:795 [inline] #1: ffff88802b883240 (&type->i_mutex_dir_key#19){++++}-{3:3}, at: vfs_removexattr+0xec/0x2b0 fs/xattr.c:574 #2: ffff8880698880b0 (&tree->tree_lock#2){+.+.}-{3:3}, at: hfsplus_find_init+0x14a/0x1c0 stack backtrace: CPU: 0 PID: 7341 Comm: syz-executor.1 Not tainted 6.9.0-rc5-syzkaller-00329-g5d12ed4bea43 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 hfsplus_find_init+0x14a/0x1c0 hfsplus_delete_attr+0x104/0x4b0 fs/hfsplus/attributes.c:321 hfsplus_removexattr fs/hfsplus/xattr.c:794 [inline] __hfsplus_setxattr+0x801/0x22d0 fs/hfsplus/xattr.c:275 hfsplus_setxattr+0xb0/0xe0 fs/hfsplus/xattr.c:434 hfsplus_security_setxattr+0x40/0x60 fs/hfsplus/xattr_security.c:31 __vfs_removexattr+0x42c/0x460 fs/xattr.c:518 __vfs_removexattr_locked+0x206/0x410 fs/xattr.c:553 vfs_removexattr+0x103/0x2b0 fs/xattr.c:575 removexattr+0x147/0x1c0 fs/xattr.c:917 path_removexattr+0x1a9/0x290 fs/xattr.c:931 __do_sys_removexattr fs/xattr.c:945 [inline] __se_sys_removexattr fs/xattr.c:942 [inline] __x64_sys_removexattr+0x60/0x70 fs/xattr.c:942 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9af887dea9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f9af95090c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000c5 RAX: ffffffffffffffda RBX: 00007f9af89abf80 RCX: 00007f9af887dea9 RDX: 0000000000000000 RSI: 0000000020000100 RDI: 0000000020000080 RBP: 00007f9af88ca4a4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f9af89abf80 R15: 00007ffd61fe0fb8