====================================================== WARNING: possible circular locking dependency detected 6.13.0-rc2-syzkaller-00292-ga446e965a188 #0 Not tainted ------------------------------------------------------ syz.5.91/6298 is trying to acquire lock: ffff888058d689c0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:818 [inline] ffff888058d689c0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{4:4}, at: ocfs2_xattr_set+0xd2e/0x2a30 fs/ocfs2/xattr.c:3622 but task is already holding lock: ffff888058d6a378 (&oi->ip_xattr_sem){++++}-{4:4}, at: ocfs2_xattr_set+0x416/0x2a30 fs/ocfs2/xattr.c:3583 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&oi->ip_xattr_sem){++++}-{4:4}: down_read+0x9a/0x330 kernel/locking/rwsem.c:1524 ocfs2_init_acl+0x2fd/0x7d0 fs/ocfs2/acl.c:366 ocfs2_mknod+0xd0a/0x2440 fs/ocfs2/namei.c:410 ocfs2_create+0x185/0x450 fs/ocfs2/namei.c:674 vfs_create fs/namei.c:3348 [inline] vfs_create+0x4c5/0x770 fs/namei.c:3332 do_mknodat+0x3d5/0x5d0 fs/namei.c:4239 __do_sys_mknod fs/namei.c:4272 [inline] __se_sys_mknod fs/namei.c:4270 [inline] __x64_sys_mknod+0x87/0xb0 fs/namei.c:4270 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #3 (jbd2_handle){++++}-{0:0}: start_this_handle+0xf92/0x1430 fs/jbd2/transaction.c:448 jbd2__journal_start+0x394/0x6a0 fs/jbd2/transaction.c:505 jbd2_journal_start+0x29/0x40 fs/jbd2/transaction.c:544 ocfs2_start_trans+0x3b9/0x970 fs/ocfs2/journal.c:352 ocfs2_modify_bh+0xbe/0x490 fs/ocfs2/quota_local.c:101 ocfs2_local_read_info+0xd68/0x1610 fs/ocfs2/quota_local.c:771 dquot_load_quota_sb+0x83d/0x1050 fs/quota/dquot.c:2459 dquot_load_quota_inode fs/quota/dquot.c:2496 [inline] dquot_load_quota_inode+0x2a3/0x470 fs/quota/dquot.c:2488 ocfs2_enable_quotas+0x28b/0x5a0 fs/ocfs2/super.c:926 ocfs2_fill_super+0x2299/0x41d0 fs/ocfs2/super.c:1141 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (&journal->j_trans_barrier){.+.+}-{4:4}: down_read+0x9a/0x330 kernel/locking/rwsem.c:1524 ocfs2_start_trans+0x3ae/0x970 fs/ocfs2/journal.c:350 ocfs2_modify_bh+0xbe/0x490 fs/ocfs2/quota_local.c:101 ocfs2_local_read_info+0xd68/0x1610 fs/ocfs2/quota_local.c:771 dquot_load_quota_sb+0x83d/0x1050 fs/quota/dquot.c:2459 dquot_load_quota_inode fs/quota/dquot.c:2496 [inline] dquot_load_quota_inode+0x2a3/0x470 fs/quota/dquot.c:2488 ocfs2_enable_quotas+0x28b/0x5a0 fs/ocfs2/super.c:926 ocfs2_fill_super+0x2299/0x41d0 fs/ocfs2/super.c:1141 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (sb_internal#2){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1725 [inline] sb_start_intwrite include/linux/fs.h:1908 [inline] ocfs2_start_trans+0x29d/0x970 fs/ocfs2/journal.c:348 ocfs2_remove_btree_range+0x413/0x1870 fs/ocfs2/alloc.c:5752 ocfs2_remove_inode_range+0x138a/0x2f20 fs/ocfs2/file.c:1907 __ocfs2_change_file_space+0xa05/0x12f0 fs/ocfs2/file.c:2028 ocfs2_fallocate+0x270/0x2f0 fs/ocfs2/file.c:2138 vfs_fallocate+0x45c/0xf90 fs/open.c:327 ioctl_preallocate+0x1a2/0x220 fs/ioctl.c:290 file_ioctl fs/ioctl.c:333 [inline] do_vfs_ioctl+0x15b1/0x1990 fs/ioctl.c:885 __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x11d/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5226 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849 down_write+0x93/0x200 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:818 [inline] ocfs2_xattr_set+0xd2e/0x2a30 fs/ocfs2/xattr.c:3622 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x142/0x170 fs/xattr.c:636 filename_setxattr+0x16d/0x1d0 fs/xattr.c:665 path_setxattrat+0x1e0/0x290 fs/xattr.c:713 __do_sys_setxattr fs/xattr.c:747 [inline] __se_sys_setxattr fs/xattr.c:743 [inline] __x64_sys_setxattr+0xc6/0x140 fs/xattr.c:743 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3 --> 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]#3); *** DEADLOCK *** 3 locks held by syz.5.91/6298: #0: ffff888052206420 (sb_writers#13){.+.+}-{0:0}, at: filename_setxattr+0xbc/0x1d0 fs/xattr.c:663 #1: ffff888058d6a640 (&sb->s_type->i_mutex_key#25){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:818 [inline] #1: ffff888058d6a640 (&sb->s_type->i_mutex_key#25){+.+.}-{4:4}, at: vfs_setxattr+0x123/0x360 fs/xattr.c:320 #2: ffff888058d6a378 (&oi->ip_xattr_sem){++++}-{4:4}, at: ocfs2_xattr_set+0x416/0x2a30 fs/ocfs2/xattr.c:3583 stack backtrace: CPU: 0 UID: 0 PID: 6298 Comm: syz.5.91 Not tainted 6.13.0-rc2-syzkaller-00292-ga446e965a188 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x419/0x5d0 kernel/locking/lockdep.c:2074 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5226 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849 down_write+0x93/0x200 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:818 [inline] ocfs2_xattr_set+0xd2e/0x2a30 fs/ocfs2/xattr.c:3622 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x142/0x170 fs/xattr.c:636 filename_setxattr+0x16d/0x1d0 fs/xattr.c:665 path_setxattrat+0x1e0/0x290 fs/xattr.c:713 __do_sys_setxattr fs/xattr.c:747 [inline] __se_sys_setxattr fs/xattr.c:743 [inline] __x64_sys_setxattr+0xc6/0x140 fs/xattr.c:743 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa045585d19 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:00007fa0462d9038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc RAX: ffffffffffffffda RBX: 00007fa045775fa0 RCX: 00007fa045585d19 RDX: 0000000020000200 RSI: 00000000200001c0 RDI: 0000000020000000 RBP: 00007fa045601a20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000841 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fa045775fa0 R15: 00007fff304d4a18 syz.5.91: attempt to access beyond end of device loop5: rw=0, sector=9808, nr_sectors = 1 limit=0 (syz.5.91,6298,1):__ocfs2_xattr_set_value_outside:1385 ERROR: status = -5 (syz.5.91,6298,1):ocfs2_xa_set:2260 ERROR: status = -5