====================================================== WARNING: possible circular locking dependency detected 6.7.0-rc4-syzkaller-00009-gbee0e7762ad2 #0 Not tainted ------------------------------------------------------ syz-executor.0/5417 is trying to acquire lock: ffff888072dbc520 (&type->i_mutex_dir_key#8/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:837 [inline] ffff888072dbc520 (&type->i_mutex_dir_key#8/2){+.+.}-{3:3}, at: xattr_rmdir fs/reiserfs/xattr.c:107 [inline] ffff888072dbc520 (&type->i_mutex_dir_key#8/2){+.+.}-{3:3}, at: delete_one_xattr+0x13e/0x2d0 fs/reiserfs/xattr.c:339 but task is already holding lock: ffff888072dbb140 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:837 [inline] ffff888072dbb140 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}, at: reiserfs_for_each_xattr+0x737/0x990 fs/reiserfs/xattr.c:310 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}: down_write_nested+0x3d/0x50 kernel/locking/rwsem.c:1695 inode_lock_nested include/linux/fs.h:837 [inline] open_xa_root fs/reiserfs/xattr.c:128 [inline] open_xa_dir+0x142/0x720 fs/reiserfs/xattr.c:153 xattr_lookup+0x1f/0x380 fs/reiserfs/xattr.c:396 reiserfs_xattr_set_handle+0x106/0xce0 fs/reiserfs/xattr.c:535 reiserfs_xattr_set+0x46a/0x5c0 fs/reiserfs/xattr.c:635 trusted_set+0xa8/0xd0 fs/reiserfs/xattr_trusted.c:31 __vfs_setxattr+0x173/0x1d0 fs/xattr.c:201 __vfs_setxattr_noperm+0x127/0x5e0 fs/xattr.c:235 __vfs_setxattr_locked+0x17e/0x250 fs/xattr.c:296 vfs_setxattr+0x146/0x350 fs/xattr.c:322 ovl_do_setxattr fs/overlayfs/overlayfs.h:310 [inline] ovl_setxattr fs/overlayfs/overlayfs.h:322 [inline] ovl_make_workdir fs/overlayfs/super.c:708 [inline] ovl_get_workdir fs/overlayfs/super.c:820 [inline] ovl_fill_super+0x1461/0x6560 fs/overlayfs/super.c:1376 vfs_get_super fs/super.c:1338 [inline] get_tree_nodev+0xd6/0x180 fs/super.c:1357 vfs_get_tree+0x8c/0x370 fs/super.c:1771 do_new_mount fs/namespace.c:3337 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3664 do_mount fs/namespace.c:3677 [inline] __do_sys_mount fs/namespace.c:3886 [inline] __se_sys_mount fs/namespace.c:3863 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:3863 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b -> #1 (&type->i_mutex_dir_key#8){++++}-{3:3}: down_write_nested+0x3d/0x50 kernel/locking/rwsem.c:1695 inode_lock_nested include/linux/fs.h:837 [inline] lock_two_inodes+0x1b2/0x1e0 fs/inode.c:1129 vfs_rename+0x4f0/0x1c30 fs/namei.c:4816 do_renameat2+0xc3c/0xdc0 fs/namei.c:4996 __do_sys_rename fs/namei.c:5042 [inline] __se_sys_rename fs/namei.c:5040 [inline] __x64_sys_rename+0x81/0xa0 fs/namei.c:5040 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b -> #0 (&type->i_mutex_dir_key#8/2){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2433/0x3b20 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719 down_write_nested+0x3d/0x50 kernel/locking/rwsem.c:1695 inode_lock_nested include/linux/fs.h:837 [inline] xattr_rmdir fs/reiserfs/xattr.c:107 [inline] delete_one_xattr+0x13e/0x2d0 fs/reiserfs/xattr.c:339 reiserfs_for_each_xattr+0x746/0x990 fs/reiserfs/xattr.c:312 reiserfs_delete_xattrs+0x1f/0x90 fs/reiserfs/xattr.c:365 reiserfs_evict_inode+0x302/0x570 fs/reiserfs/inode.c:53 evict+0x2ed/0x6b0 fs/inode.c:666 iput_final fs/inode.c:1777 [inline] iput.part.0+0x560/0x7b0 fs/inode.c:1803 iput+0x5c/0x80 fs/inode.c:1793 dentry_unlink_inode+0x292/0x430 fs/dcache.c:401 __dentry_kill+0x3b8/0x640 fs/dcache.c:607 dentry_kill fs/dcache.c:745 [inline] dput+0x6de/0xd90 fs/dcache.c:913 cleanup_mnt+0x1fa/0x450 fs/namespace.c:1255 task_work_run+0x14d/0x240 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x217/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1e/0x60 kernel/entry/common.c:296 do_syscall_64+0x4d/0x110 arch/x86/entry/common.c:88 entry_SYSCALL_64_after_hwframe+0x63/0x6b other info that might help us debug this: Chain exists of: &type->i_mutex_dir_key#8/2 --> &type->i_mutex_dir_key#8 --> &type->i_mutex_dir_key#8/3 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&type->i_mutex_dir_key#8/3); lock(&type->i_mutex_dir_key#8); lock(&type->i_mutex_dir_key#8/3); lock(&type->i_mutex_dir_key#8/2); *** DEADLOCK *** 1 lock held by syz-executor.0/5417: #0: ffff888072dbb140 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:837 [inline] #0: ffff888072dbb140 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}, at: reiserfs_for_each_xattr+0x737/0x990 fs/reiserfs/xattr.c:310 stack backtrace: CPU: 1 PID: 5417 Comm: syz-executor.0 Not tainted 6.7.0-rc4-syzkaller-00009-gbee0e7762ad2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x317/0x400 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 kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2433/0x3b20 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719 down_write_nested+0x3d/0x50 kernel/locking/rwsem.c:1695 inode_lock_nested include/linux/fs.h:837 [inline] xattr_rmdir fs/reiserfs/xattr.c:107 [inline] delete_one_xattr+0x13e/0x2d0 fs/reiserfs/xattr.c:339 reiserfs_for_each_xattr+0x746/0x990 fs/reiserfs/xattr.c:312 reiserfs_delete_xattrs+0x1f/0x90 fs/reiserfs/xattr.c:365 reiserfs_evict_inode+0x302/0x570 fs/reiserfs/inode.c:53 evict+0x2ed/0x6b0 fs/inode.c:666 iput_final fs/inode.c:1777 [inline] iput.part.0+0x560/0x7b0 fs/inode.c:1803 iput+0x5c/0x80 fs/inode.c:1793 dentry_unlink_inode+0x292/0x430 fs/dcache.c:401 __dentry_kill+0x3b8/0x640 fs/dcache.c:607 dentry_kill fs/dcache.c:745 [inline] dput+0x6de/0xd90 fs/dcache.c:913 cleanup_mnt+0x1fa/0x450 fs/namespace.c:1255 task_work_run+0x14d/0x240 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x217/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1e/0x60 kernel/entry/common.c:296 do_syscall_64+0x4d/0x110 arch/x86/entry/common.c:88 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7fd3d287dc87 Code: b0 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 b0 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007ffffd924098 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007fd3d287dc87 RDX: 0000000000000000 RSI: 000000000000000a RDI: 00007ffffd924150 RBP: 00007ffffd924150 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffffd925210 R13: 00007fd3d28d7c5a R14: 000000000001465d R15: 0000000000000008