ocfs2: Mounting device (7,0) on (node local, slot 0) with ordered data mode. ====================================================== WARNING: possible circular locking dependency detected 6.1.114-syzkaller #0 Not tainted ------------------------------------------------------ syz.0.152/4919 is trying to acquire lock: ffff8880587809c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] ffff8880587809c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}, at: ocfs2_xattr_set+0xe96/0x1930 fs/ocfs2/xattr.c:3627 but task is already holding lock: ffff8880585431b8 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_xattr_set+0x62f/0x1930 fs/ocfs2/xattr.c:3588 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&oi->ip_xattr_sem){++++}-{3:3}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 down_read+0xad/0xa30 kernel/locking/rwsem.c:1520 ocfs2_init_acl+0x398/0x930 fs/ocfs2/acl.c:365 ocfs2_mknod+0x1f75/0x2e20 fs/ocfs2/namei.c:408 vfs_mknod+0x444/0x4d0 fs/namei.c:3985 do_mknodat+0x3f8/0x5a0 __do_sys_mknodat fs/namei.c:4063 [inline] __se_sys_mknodat fs/namei.c:4060 [inline] __x64_sys_mknodat+0xa5/0xc0 fs/namei.c:4060 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 -> #1 (jbd2_handle){++++}-{0:0}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 jbd2_journal_lock_updates+0xa6/0x380 fs/jbd2/transaction.c:880 __ocfs2_flush_truncate_log+0x2ef/0x12a0 fs/ocfs2/alloc.c:6022 ocfs2_flush_truncate_log+0x4b/0x60 fs/ocfs2/alloc.c:6069 ocfs2_sync_fs+0x121/0x380 fs/ocfs2/super.c:402 sync_filesystem+0x1bc/0x220 fs/sync.c:66 generic_shutdown_super+0x6b/0x340 fs/super.c:474 kill_block_super+0x7a/0xe0 fs/super.c:1470 deactivate_locked_super+0xa0/0x110 fs/super.c:332 cleanup_mnt+0x490/0x520 fs/namespace.c:1186 task_work_run+0x246/0x300 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xde/0x100 kernel/entry/common.c:177 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:303 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{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 down_write+0x36/0x60 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] ocfs2_xattr_set+0xe96/0x1930 fs/ocfs2/xattr.c:3627 __vfs_setxattr+0x3e7/0x420 fs/xattr.c:182 __vfs_setxattr_noperm+0x12a/0x5e0 fs/xattr.c:216 vfs_setxattr+0x21d/0x420 fs/xattr.c:309 do_setxattr fs/xattr.c:594 [inline] setxattr+0x250/0x2b0 fs/xattr.c:617 path_setxattr+0x1bc/0x2a0 fs/xattr.c:636 __do_sys_lsetxattr fs/xattr.c:659 [inline] __se_sys_lsetxattr fs/xattr.c:655 [inline] __x64_sys_lsetxattr+0xb4/0xd0 fs/xattr.c:655 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: Chain exists of: &ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5 --> jbd2_handle --> &oi->ip_xattr_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&oi->ip_xattr_sem); lock(jbd2_handle); lock(&oi->ip_xattr_sem); lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5); *** DEADLOCK *** 3 locks held by syz.0.152/4919: #0: ffff88802c868460 (sb_writers#13){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:393 #1: ffff888058543488 (&type->i_mutex_dir_key#8){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff888058543488 (&type->i_mutex_dir_key#8){+.+.}-{3:3}, at: vfs_setxattr+0x1dd/0x420 fs/xattr.c:308 #2: ffff8880585431b8 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_xattr_set+0x62f/0x1930 fs/ocfs2/xattr.c:3588 stack backtrace: CPU: 1 PID: 4919 Comm: syz.0.152 Not tainted 6.1.114-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/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 down_write+0x36/0x60 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] ocfs2_xattr_set+0xe96/0x1930 fs/ocfs2/xattr.c:3627 __vfs_setxattr+0x3e7/0x420 fs/xattr.c:182 __vfs_setxattr_noperm+0x12a/0x5e0 fs/xattr.c:216 vfs_setxattr+0x21d/0x420 fs/xattr.c:309 do_setxattr fs/xattr.c:594 [inline] setxattr+0x250/0x2b0 fs/xattr.c:617 path_setxattr+0x1bc/0x2a0 fs/xattr.c:636 __do_sys_lsetxattr fs/xattr.c:659 [inline] __se_sys_lsetxattr fs/xattr.c:655 [inline] __x64_sys_lsetxattr+0xb4/0xd0 fs/xattr.c:655 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:0x7fd9d957e719 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:00007fd9da3bb038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd RAX: ffffffffffffffda RBX: 00007fd9d9735f80 RCX: 00007fd9d957e719 RDX: 0000000020000500 RSI: 0000000020000080 RDI: 0000000020000040 RBP: 00007fd9d95f132e R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000e01 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fd9d9735f80 R15: 00007fff0dbcb028