====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.7.2264/22164 is trying to acquire lock: ffff888074ebe0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfsplus_find_init+0x150/0x1c0 fs/hfsplus/bfind.c:28 but task is already holding lock: ffff8880236fb048 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1ca/0x1a40 fs/hfsplus/extents.c:455 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 kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12d/0xae0 kernel/locking/mutex.c:747 hfsplus_file_extend+0x1ca/0x1a40 fs/hfsplus/extents.c:455 hfsplus_bmap_reserve+0x107/0x510 fs/hfsplus/btree.c:358 __hfsplus_ext_write_extent+0x264/0x520 fs/hfsplus/extents.c:104 __hfsplus_ext_cache_extent+0x81/0xbd0 fs/hfsplus/extents.c:186 hfsplus_ext_read_extent fs/hfsplus/extents.c:218 [inline] hfsplus_file_extend+0x4b9/0x1a40 fs/hfsplus/extents.c:459 hfsplus_get_block+0x41d/0x1520 fs/hfsplus/extents.c:245 __block_write_begin_int+0x577/0x1ab0 fs/buffer.c:1991 __block_write_begin fs/buffer.c:2041 [inline] block_write_begin+0x96/0x1e0 fs/buffer.c:2102 cont_write_begin+0x5f9/0x800 fs/buffer.c:2456 hfsplus_write_begin+0x87/0xd0 fs/hfsplus/inode.c:52 generic_perform_write+0x2fa/0x5c0 mm/filemap.c:3862 __generic_file_write_iter+0x148/0x2a0 mm/filemap.c:3960 generic_file_write_iter+0xab/0x2e0 mm/filemap.c:3989 call_write_iter include/linux/fs.h:2265 [inline] aio_write+0x545/0x780 fs/aio.c:1615 __io_submit_one fs/aio.c:-1 [inline] io_submit_one+0x6ea/0x1340 fs/aio.c:2034 __do_sys_io_submit fs/aio.c:2093 [inline] __se_sys_io_submit+0x19d/0x310 fs/aio.c:2063 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&tree->tree_lock/1){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3830 [inline] __lock_acquire+0x2d18/0x7c40 kernel/locking/lockdep.c:5063 lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5676 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12d/0xae0 kernel/locking/mutex.c:747 hfsplus_find_init+0x150/0x1c0 fs/hfsplus/bfind.c:28 hfsplus_ext_read_extent fs/hfsplus/extents.c:216 [inline] hfsplus_file_extend+0x465/0x1a40 fs/hfsplus/extents.c:459 hfsplus_create_attributes_file fs/hfsplus/xattr.c:198 [inline] __hfsplus_setxattr+0xb3d/0x1f00 fs/hfsplus/xattr.c:335 hfsplus_setxattr+0xd8/0x120 fs/hfsplus/xattr.c:438 hfsplus_security_setxattr+0x3c/0x50 fs/hfsplus/xattr_security.c:31 __vfs_setxattr+0x3d8/0x410 fs/xattr.c:182 __vfs_setxattr_noperm+0x126/0x5e0 fs/xattr.c:216 vfs_setxattr+0x167/0x2e0 fs/xattr.c:309 do_setxattr fs/xattr.c:594 [inline] setxattr+0x2a3/0x330 fs/xattr.c:617 path_setxattr+0x147/0x290 fs/xattr.c:636 __do_sys_setxattr fs/xattr.c:652 [inline] __se_sys_setxattr fs/xattr.c:648 [inline] __x64_sys_setxattr+0xb7/0xd0 fs/xattr.c:648 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 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/1); lock(&HFSPLUS_I(inode)->extents_lock); lock(&tree->tree_lock/1); *** DEADLOCK *** 4 locks held by syz.7.2264/22164: #0: ffff888020c10460 (sb_writers#25){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:402 #1: ffff888077b8d400 (&sb->s_type->i_mutex_key#30){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff888077b8d400 (&sb->s_type->i_mutex_key#30){+.+.}-{3:3}, at: vfs_setxattr+0x140/0x2e0 fs/xattr.c:308 #2: ffff8880446b00b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_find_init+0x150/0x1c0 fs/hfsplus/bfind.c:28 #3: ffff8880236fb048 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1ca/0x1a40 fs/hfsplus/extents.c:455 stack backtrace: CPU: 1 PID: 22164 Comm: syz.7.2264 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106 check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3830 [inline] __lock_acquire+0x2d18/0x7c40 kernel/locking/lockdep.c:5063 lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5676 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12d/0xae0 kernel/locking/mutex.c:747 hfsplus_find_init+0x150/0x1c0 fs/hfsplus/bfind.c:28 hfsplus_ext_read_extent fs/hfsplus/extents.c:216 [inline] hfsplus_file_extend+0x465/0x1a40 fs/hfsplus/extents.c:459 hfsplus_create_attributes_file fs/hfsplus/xattr.c:198 [inline] __hfsplus_setxattr+0xb3d/0x1f00 fs/hfsplus/xattr.c:335 hfsplus_setxattr+0xd8/0x120 fs/hfsplus/xattr.c:438 hfsplus_security_setxattr+0x3c/0x50 fs/hfsplus/xattr_security.c:31 __vfs_setxattr+0x3d8/0x410 fs/xattr.c:182 __vfs_setxattr_noperm+0x126/0x5e0 fs/xattr.c:216 vfs_setxattr+0x167/0x2e0 fs/xattr.c:309 do_setxattr fs/xattr.c:594 [inline] setxattr+0x2a3/0x330 fs/xattr.c:617 path_setxattr+0x147/0x290 fs/xattr.c:636 __do_sys_setxattr fs/xattr.c:652 [inline] __se_sys_setxattr fs/xattr.c:648 [inline] __x64_sys_setxattr+0xb7/0xd0 fs/xattr.c:648 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fef7b59e0d9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fef7c550028 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc RAX: ffffffffffffffda RBX: 00007fef7b825fa0 RCX: 00007fef7b59e0d9 RDX: 00002000000013c0 RSI: 0000200000000140 RDI: 0000200000000100 RBP: 00007fef7b635024 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000700 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fef7b826038 R14: 00007fef7b825fa0 R15: 00007ffcb7383db8 hfsplus: failed to extend attributes file