loop3: detected capacity change from 0 to 32768
ocfs2: Mounting device (7,3) on (node local, slot 0) with ordered data mode.
======================================================
WARNING: possible circular locking dependency detected
6.1.111-syzkaller #0 Not tainted
------------------------------------------------------
syz.3.1949/9628 is trying to acquire lock:
ffff8880599ba648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
ffff8880599ba648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}, at: ocfs2_xattr_set+0xe96/0x1930 fs/ocfs2/xattr.c:3618
but task is already holding lock:
ffff8880599bdc78 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_xattr_set+0x62f/0x1930 fs/ocfs2/xattr.c:3579
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
ocfs2_mkdir+0x1c0/0x4e0 fs/ocfs2/namei.c:655
vfs_mkdir+0x3b6/0x590 fs/namei.c:4108
do_mkdirat+0x225/0x360 fs/namei.c:4133
__do_sys_mkdir fs/namei.c:4153 [inline]
__se_sys_mkdir fs/namei.c:4151 [inline]
__x64_sys_mkdir+0x6a/0x80 fs/namei.c:4151
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:3618
__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.3.1949/9628:
#0: ffff8880270b8460 (sb_writers#15){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:393
#1: ffff8880599bdf48 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
#1: ffff8880599bdf48 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: vfs_setxattr+0x1dd/0x420 fs/xattr.c:308
#2: ffff8880599bdc78 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_xattr_set+0x62f/0x1930 fs/ocfs2/xattr.c:3579
stack backtrace:
CPU: 1 PID: 9628 Comm: syz.3.1949 Not tainted 6.1.111-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
<TASK>
__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:3618
__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:0x7f526cd7def9
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:00007f526dc16038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd
RAX: ffffffffffffffda RBX: 00007f526cf35f80 RCX: 00007f526cd7def9
RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000020000080
RBP: 00007f526cdf0b76 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f526cf35f80 R15: 00007ffd5c2fdc38
</TASK>