====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.4.146/6552 is trying to acquire lock: ffff88807d428418 (sb_writers#22){.+.+}-{0:0}, at: mnt_want_write_file+0x63/0x200 fs/namespace.c:456 but task is already holding lock: ffff88807cf33090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x79/0xd0 fs/reiserfs/lock.c:27 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&sbi->lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x129/0xcc0 kernel/locking/mutex.c:747 reiserfs_write_lock+0x79/0xd0 fs/reiserfs/lock.c:27 reiserfs_lookup+0x151/0x520 fs/reiserfs/namei.c:364 __lookup_slow+0x281/0x3b0 fs/namei.c:1702 lookup_one_len+0x192/0x2c0 fs/namei.c:2752 reiserfs_lookup_privroot+0x89/0x180 fs/reiserfs/xattr.c:977 reiserfs_fill_super+0x1f44/0x2340 fs/reiserfs/super.c:2174 mount_bdev+0x22b/0x2d0 fs/super.c:1643 legacy_get_tree+0xea/0x180 fs/fs_context.c:662 vfs_get_tree+0x8c/0x280 fs/super.c:1764 do_new_mount+0x24b/0xa40 fs/namespace.c:3386 do_mount fs/namespace.c:3726 [inline] __do_sys_mount fs/namespace.c:3935 [inline] __se_sys_mount+0x2da/0x3c0 fs/namespace.c:3912 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #1 (&type->i_mutex_dir_key#12){+.+.}-{3:3}: down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:804 [inline] open_last_lookups fs/namei.c:3561 [inline] path_openat+0x7c6/0x3190 fs/namei.c:3794 do_filp_open+0x1c5/0x3d0 fs/namei.c:3824 do_sys_openat2+0x12c/0x1c0 fs/open.c:1421 do_sys_open fs/open.c:1436 [inline] __do_sys_openat fs/open.c:1452 [inline] __se_sys_openat fs/open.c:1447 [inline] __x64_sys_openat+0x139/0x160 fs/open.c:1447 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (sb_writers#22){.+.+}-{0:0}: 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+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1633 [inline] sb_start_write+0x4d/0x1c0 include/linux/fs.h:1708 mnt_want_write_file+0x63/0x200 fs/namespace.c:456 reiserfs_ioctl+0x112/0x2d0 fs/reiserfs/ioctl.c:103 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/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: sb_writers#22 --> &type->i_mutex_dir_key#12 --> &sbi->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sbi->lock); lock(&type->i_mutex_dir_key#12); lock(&sbi->lock); rlock(sb_writers#22); *** DEADLOCK *** 1 lock held by syz.4.146/6552: #0: ffff88807cf33090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x79/0xd0 fs/reiserfs/lock.c:27 stack backtrace: CPU: 0 PID: 6552 Comm: syz.4.146 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Call Trace: dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106 check_noncircular+0x2bd/0x3c0 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+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1633 [inline] sb_start_write+0x4d/0x1c0 include/linux/fs.h:1708 mnt_want_write_file+0x63/0x200 fs/namespace.c:456 reiserfs_ioctl+0x112/0x2d0 fs/reiserfs/ioctl.c:103 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f9a3b78f749 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:00007f9a3c5ae038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f9a3b9e6090 RCX: 00007f9a3b78f749 RDX: 0000000000000000 RSI: 0000000040087602 RDI: 0000000000000005 RBP: 00007f9a3b813f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f9a3b9e6128 R14: 00007f9a3b9e6090 R15: 00007ffc67d796c8