====================================================== WARNING: possible circular locking dependency detected 6.1.110-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor/4295 is trying to acquire lock: ffff0000df5ad900 (&type->i_mutex_dir_key#15/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] ffff0000df5ad900 (&type->i_mutex_dir_key#15/2){+.+.}-{3:3}, at: xattr_rmdir fs/reiserfs/xattr.c:106 [inline] ffff0000df5ad900 (&type->i_mutex_dir_key#15/2){+.+.}-{3:3}, at: delete_one_xattr+0xe8/0x2c8 fs/reiserfs/xattr.c:338 but task is already holding lock: ffff0000f2ecb7e0 (&type->i_mutex_dir_key#15/3){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] ffff0000f2ecb7e0 (&type->i_mutex_dir_key#15/3){+.+.}-{3:3}, at: reiserfs_for_each_xattr+0x788/0x8d8 fs/reiserfs/xattr.c:309 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&type->i_mutex_dir_key#15/3){+.+.}-{3:3}: down_write_nested+0x64/0x94 kernel/locking/rwsem.c:1689 inode_lock_nested include/linux/fs.h:793 [inline] open_xa_root fs/reiserfs/xattr.c:127 [inline] open_xa_dir+0x11c/0x578 fs/reiserfs/xattr.c:152 xattr_lookup+0x3c/0x268 fs/reiserfs/xattr.c:395 reiserfs_xattr_set_handle+0xe4/0xe90 fs/reiserfs/xattr.c:533 reiserfs_xattr_set+0x398/0x4b0 fs/reiserfs/xattr.c:633 trusted_set+0x98/0xec fs/reiserfs/xattr_trusted.c:31 __vfs_setxattr+0x388/0x3a4 fs/xattr.c:182 __vfs_setxattr_noperm+0x110/0x528 fs/xattr.c:216 __vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:277 vfs_setxattr+0x1a8/0x344 fs/xattr.c:309 ovl_do_setxattr fs/overlayfs/overlayfs.h:252 [inline] ovl_setxattr fs/overlayfs/overlayfs.h:264 [inline] ovl_make_workdir fs/overlayfs/super.c:1435 [inline] ovl_get_workdir+0xc00/0x13d4 fs/overlayfs/super.c:1539 ovl_fill_super+0x15b4/0x2254 fs/overlayfs/super.c:2095 mount_nodev+0x68/0x104 fs/super.c:1489 ovl_mount+0x3c/0x50 fs/overlayfs/super.c:2186 legacy_get_tree+0xd4/0x16c fs/fs_context.c:632 vfs_get_tree+0x90/0x274 fs/super.c:1573 do_new_mount+0x278/0x8fc fs/namespace.c:3051 path_mount+0x590/0xe5c fs/namespace.c:3381 do_mount fs/namespace.c:3394 [inline] __do_sys_mount fs/namespace.c:3602 [inline] __se_sys_mount fs/namespace.c:3579 [inline] __arm64_sys_mount+0x45c/0x594 fs/namespace.c:3579 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #1 (&type->i_mutex_dir_key#15){++++}-{3:3}: down_write+0x5c/0x88 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] vfs_rename+0x68c/0xe04 fs/namei.c:4841 do_renameat2+0x9ec/0xe64 fs/namei.c:5029 __do_sys_renameat2 fs/namei.c:5062 [inline] __se_sys_renameat2 fs/namei.c:5059 [inline] __arm64_sys_renameat2+0xe0/0xfc fs/namei.c:5059 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #0 (&type->i_mutex_dir_key#15/2){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x3338/0x7680 kernel/locking/lockdep.c:5049 lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5662 down_write_nested+0x64/0x94 kernel/locking/rwsem.c:1689 inode_lock_nested include/linux/fs.h:793 [inline] xattr_rmdir fs/reiserfs/xattr.c:106 [inline] delete_one_xattr+0xe8/0x2c8 fs/reiserfs/xattr.c:338 reiserfs_for_each_xattr+0x794/0x8d8 fs/reiserfs/xattr.c:311 reiserfs_delete_xattrs+0x2c/0xa4 fs/reiserfs/xattr.c:364 reiserfs_evict_inode+0x1dc/0x3f0 fs/reiserfs/inode.c:53 evict+0x418/0x894 fs/inode.c:701 iput_final fs/inode.c:1826 [inline] iput+0x7c0/0x8a4 fs/inode.c:1852 d_delete_notify include/linux/fsnotify.h:267 [inline] vfs_rmdir+0x330/0x43c fs/namei.c:4206 do_rmdir+0x2e0/0x720 fs/namei.c:4254 __do_sys_unlinkat fs/namei.c:4434 [inline] __se_sys_unlinkat fs/namei.c:4428 [inline] __arm64_sys_unlinkat+0xe0/0xfc fs/namei.c:4428 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 other info that might help us debug this: Chain exists of: &type->i_mutex_dir_key#15/2 --> &type->i_mutex_dir_key#15 --> &type->i_mutex_dir_key#15/3 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&type->i_mutex_dir_key#15/3); lock(&type->i_mutex_dir_key#15); lock(&type->i_mutex_dir_key#15/3); lock(&type->i_mutex_dir_key#15/2); *** DEADLOCK *** 3 locks held by syz-executor/4295: #0: ffff0000db0ae460 (sb_writers#25){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:393 #1: ffff0000df5ab7e0 (&type->i_mutex_dir_key#15/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #1: ffff0000df5ab7e0 (&type->i_mutex_dir_key#15/1){+.+.}-{3:3}, at: do_rmdir+0x1d8/0x720 fs/namei.c:4241 #2: ffff0000f2ecb7e0 (&type->i_mutex_dir_key#15/3){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #2: ffff0000f2ecb7e0 (&type->i_mutex_dir_key#15/3){+.+.}-{3:3}, at: reiserfs_for_each_xattr+0x788/0x8d8 fs/reiserfs/xattr.c:309 stack backtrace: CPU: 1 PID: 4295 Comm: syz-executor Not tainted 6.1.110-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2048 check_noncircular+0x2cc/0x378 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 kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x3338/0x7680 kernel/locking/lockdep.c:5049 lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5662 down_write_nested+0x64/0x94 kernel/locking/rwsem.c:1689 inode_lock_nested include/linux/fs.h:793 [inline] xattr_rmdir fs/reiserfs/xattr.c:106 [inline] delete_one_xattr+0xe8/0x2c8 fs/reiserfs/xattr.c:338 reiserfs_for_each_xattr+0x794/0x8d8 fs/reiserfs/xattr.c:311 reiserfs_delete_xattrs+0x2c/0xa4 fs/reiserfs/xattr.c:364 reiserfs_evict_inode+0x1dc/0x3f0 fs/reiserfs/inode.c:53 evict+0x418/0x894 fs/inode.c:701 iput_final fs/inode.c:1826 [inline] iput+0x7c0/0x8a4 fs/inode.c:1852 d_delete_notify include/linux/fsnotify.h:267 [inline] vfs_rmdir+0x330/0x43c fs/namei.c:4206 do_rmdir+0x2e0/0x720 fs/namei.c:4254 __do_sys_unlinkat fs/namei.c:4434 [inline] __se_sys_unlinkat fs/namei.c:4428 [inline] __arm64_sys_unlinkat+0xe0/0xfc fs/namei.c:4428 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 REISERFS warning (device loop4): vs-13060 reiserfs_update_sd_size: stat data of object [1 2 0x0 SD] (nlink == 5) not found (pos 2) REISERFS warning (device loop4): vs-13060 reiserfs_update_sd_size: stat data of object [1 2 0x0 SD] (nlink == 5) not found (pos 2) REISERFS warning (device loop4): vs-13060 reiserfs_update_sd_size: stat data of object [1 2 0x0 SD] (nlink == 4) not found (pos 2)