syzbot
possible deadlock in vfs_rename (3)
Status:
upstream: reported on 2026/09/23 18:33
Subsystems:
ocfs2
Labels:
prio:high
[Documentation on labels]
Reported-by: syzbot+c73ff6790f3d6c635abc@syzkaller.appspotmail.com
First crash: 4d11h, last: 4d11h
Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Tainted: G L
------------------------------------------------------
syz.1.4093/19971 is trying to acquire lock:
ffff888077a8eba0 (&sb->s_type->i_mutex_key#25){++++}-{4:4}, at: inode_lock include/linux/fs.h:1024 [inline]
ffff888077a8eba0 (&sb->s_type->i_mutex_key#25){++++}-{4:4}, at: vfs_rename+0x566/0x2000 fs/namei.c:6162
but task is already holding lock:
ffff888077a8cfa0 (&sb->s_type->i_mutex_key#25/2){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1069 [inline]
ffff888077a8cfa0 (&sb->s_type->i_mutex_key#25/2){+.+.}-{4:4}, at: vfs_rename+0x542/0x2000 fs/namei.c:6160
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #3 (&sb->s_type->i_mutex_key#25/2){+.+.}-{4:4}:
lock_acquire kernel/locking/lockdep.c:5942 [inline]
lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899
down_write_nested+0x94/0x200 kernel/locking/rwsem.c:1757
inode_lock_nested include/linux/fs.h:1069 [inline]
__ocfs2_reflink.isra.0+0x328/0x1c50 fs/ocfs2/refcounttree.c:4198
ocfs2_reflink+0x5cf/0xbb0 fs/ocfs2/refcounttree.c:4297
ocfs2_vfs_reflink fs/ocfs2/refcounttree.c:4423 [inline]
ocfs2_reflink_ioctl+0x7cd/0xa60 fs/ocfs2/refcounttree.c:4463
ocfs2_ioctl+0x5e8/0x6e0 fs/ocfs2/ioctl.c:920
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #2 (&ocfs2_quota_ip_alloc_sem_key){++++}-{4:4}:
lock_acquire kernel/locking/lockdep.c:5942 [inline]
lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899
down_write+0x8b/0x1f0 kernel/locking/rwsem.c:1631
ocfs2_reflink+0x596/0xbb0 fs/ocfs2/refcounttree.c:4296
ocfs2_vfs_reflink fs/ocfs2/refcounttree.c:4423 [inline]
ocfs2_reflink_ioctl+0x7cd/0xa60 fs/ocfs2/refcounttree.c:4463
ocfs2_ioctl+0x5e8/0x6e0 fs/ocfs2/ioctl.c:920
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #1 (&oi->ip_xattr_sem){++++}-{4:4}:
lock_acquire kernel/locking/lockdep.c:5942 [inline]
lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899
down_read+0x99/0x4c0 kernel/locking/rwsem.c:1574
ocfs2_xattr_get+0x10f/0x270 fs/ocfs2/xattr.c:1578
__vfs_getxattr+0x13d/0x1a0 fs/xattr.c:446
cap_inode_need_killpriv+0x40/0x60 security/commoncap.c:331
security_inode_need_killpriv+0x87/0x1e0 security/security.c:2186
notify_change+0x779/0x1330 fs/attr.c:481
chown_common+0x51e/0x6e0 fs/open.c:825
do_fchownat+0x18e/0x1f0 fs/open.c:853
__do_sys_chown fs/open.c:873 [inline]
__se_sys_chown fs/open.c:871 [inline]
__x64_sys_chown+0x7b/0xc0 fs/open.c:871
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #0 (&sb->s_type->i_mutex_key#25){++++}-{4:4}:
check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3209
check_prevs_add kernel/locking/lockdep.c:3328 [inline]
validate_chain kernel/locking/lockdep.c:3952 [inline]
__lock_acquire+0x1528/0x1f40 kernel/locking/lockdep.c:5288
lock_acquire kernel/locking/lockdep.c:5942 [inline]
lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899
down_write+0x8b/0x1f0 kernel/locking/rwsem.c:1631
inode_lock include/linux/fs.h:1024 [inline]
vfs_rename+0x566/0x2000 fs/namei.c:6162
filename_renameat2+0x754/0xa60 fs/namei.c:6326
__do_sys_rename fs/namei.c:6370 [inline]
__se_sys_rename fs/namei.c:6366 [inline]
__x64_sys_rename+0x81/0xb0 fs/namei.c:6366
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
other info that might help us debug this:
Chain exists of:
&sb->s_type->i_mutex_key#25 --> &ocfs2_quota_ip_alloc_sem_key --> &sb->s_type->i_mutex_key#25/2
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&sb->s_type->i_mutex_key#25/2);
lock(&ocfs2_quota_ip_alloc_sem_key);
lock(&sb->s_type->i_mutex_key#25/2);
lock(&sb->s_type->i_mutex_key#25);
*** DEADLOCK ***
locks held by syz.1.4093/19971: 5, last CPU#1:
#0: ffff88802476a460 (sb_writers#14){.+.+}-{0:0}, at: filename_renameat2+0x3af/0xa60 fs/namei.c:6290
#1: ffff88802476a768 (&type->s_vfs_rename_key#5){+.+.}-{4:4}, at: lock_rename fs/namei.c:3789 [inline]
#1: ffff88802476a768 (&type->s_vfs_rename_key#5){+.+.}-{4:4}, at: __start_renaming+0x111/0x520 fs/namei.c:3878
#2: ffff88804fd1c1a0 (&type->i_mutex_dir_key#10/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1069 [inline]
#2: ffff88804fd1c1a0 (&type->i_mutex_dir_key#10/1){+.+.}-{4:4}, at: lock_two_directories+0x162/0x2d0 fs/namei.c:3765
#3: ffff888077a8f9a0 (&sb->s_type->i_mutex_key#25/5){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1069 [inline]
#3: ffff888077a8f9a0 (&sb->s_type->i_mutex_key#25/5){+.+.}-{4:4}, at: lock_two_directories+0x199/0x2d0 fs/namei.c:3766
#4: ffff888077a8cfa0 (&sb->s_type->i_mutex_key#25/2){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1069 [inline]
#4: ffff888077a8cfa0 (&sb->s_type->i_mutex_key#25/2){+.+.}-{4:4}, at: vfs_rename+0x542/0x2000 fs/namei.c:6160
stack backtrace:
CPU: 1 UID: 0 PID: 19971 Comm: syz.1.4093 Tainted: G L syzkaller #0 PREEMPT(full)
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2026
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_circular_bug.cold+0x178/0x1be kernel/locking/lockdep.c:2087
check_noncircular+0x146/0x160 kernel/locking/lockdep.c:2219
check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3209
check_prevs_add kernel/locking/lockdep.c:3328 [inline]
validate_chain kernel/locking/lockdep.c:3952 [inline]
__lock_acquire+0x1528/0x1f40 kernel/locking/lockdep.c:5288
lock_acquire kernel/locking/lockdep.c:5942 [inline]
lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899
down_write+0x8b/0x1f0 kernel/locking/rwsem.c:1631
inode_lock include/linux/fs.h:1024 [inline]
vfs_rename+0x566/0x2000 fs/namei.c:6162
filename_renameat2+0x754/0xa60 fs/namei.c:6326
__do_sys_rename fs/namei.c:6370 [inline]
__se_sys_rename fs/namei.c:6366 [inline]
__x64_sys_rename+0x81/0xb0 fs/namei.c:6366
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f3e8219e159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f3e82fa2028 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 00007f3e82425fa0 RCX: 00007f3e8219e159
RDX: 0000000000000000 RSI: 0000200000002440 RDI: 0000200000002340
RBP: 00007f3e8223506b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f3e82426038 R14: 00007f3e82425fa0 R15: 00007fffbb292648
</TASK>
(syz.1.4093,19971,1):ocfs2_double_lock:1202 ERROR: status = -2
(syz.1.4093,19971,1):ocfs2_rename:1311 ERROR: status = -2
(syz.1.4093,19971,1):ocfs2_rename:1711 ERROR: status = -2
* Struck through repros no longer work on HEAD.