syzbot
possible deadlock in vfs_rename (2)
Status:
upstream: reported on 2026/11/28 05:47
Reported-by: syzbot+b59bfb2fa0538207807a@syzkaller.appspotmail.com
First crash: 1d10h, last: 1d10h
Sample crash report:
ocfs2: Mounting device (7,6) on (node local, slot 0) with ordered data mode.
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.6.2719/18002 is trying to acquire lock:
ffff888048992658 (&sb->s_type->i_mutex_key#32){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:806 [inline]
ffff888048992658 (&sb->s_type->i_mutex_key#32){+.+.}-{3:3}, at: vfs_rename+0x6f4/0xe60 fs/namei.c:-1
but task is already holding lock:
ffff88804d9c89d8 (&sb->s_type->i_mutex_key#32/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:841 [inline]
ffff88804d9c89d8 (&sb->s_type->i_mutex_key#32/2){+.+.}-{3:3}, at: vfs_rename+0x65e/0xe60 fs/namei.c:4902
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #3 (&sb->s_type->i_mutex_key#32/2){+.+.}-{3:3}:
down_write_nested+0x9e/0x200 kernel/locking/rwsem.c:1689
inode_lock_nested include/linux/fs.h:841 [inline]
__ocfs2_reflink+0xca8/0x16e0 fs/ocfs2/refcounttree.c:4206
ocfs2_reflink+0x4e8/0x920 fs/ocfs2/refcounttree.c:4305
ocfs2_vfs_reflink+0x333/0x450 fs/ocfs2/refcounttree.c:4431
ocfs2_reflink_ioctl+0x3a0/0x450 fs/ocfs2/refcounttree.c:4471
ocfs2_ioctl+0x5b9/0x7e0 fs/ocfs2/ioctl.c:923
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:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
-> #2 (
&oi->ip_alloc_sem){+.+.}-{3:3}
:
down_write+0x97/0x200 kernel/locking/rwsem.c:1573
ocfs2_reflink+0x4cf/0x920 fs/ocfs2/refcounttree.c:4304
ocfs2_vfs_reflink+0x333/0x450 fs/ocfs2/refcounttree.c:4431
ocfs2_reflink_ioctl+0x3a0/0x450 fs/ocfs2/refcounttree.c:4471
ocfs2_ioctl+0x5b9/0x7e0 fs/ocfs2/ioctl.c:923
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:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
-> #1
(&oi->ip_xattr_sem
){++++}-{3:3}
:
down_write+0x97/0x200 kernel/locking/rwsem.c:1573
ocfs2_reflink+0x4c0/0x920 fs/ocfs2/refcounttree.c:4303
ocfs2_vfs_reflink+0x333/0x450 fs/ocfs2/refcounttree.c:4431
ocfs2_reflink_ioctl+0x3a0/0x450 fs/ocfs2/refcounttree.c:4471
ocfs2_ioctl+0x5b9/0x7e0 fs/ocfs2/ioctl.c:923
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:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
-> #0 (
&sb->s_type->i_mutex_key
#32
){+.+.}-{3:3}
:
check_prev_add kernel/locking/lockdep.c:3162 [inline]
check_prevs_add kernel/locking/lockdep.c:3281 [inline]
validate_chain kernel/locking/lockdep.c:3897 [inline]
__lock_acquire+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171
lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790
down_write+0x97/0x200 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:806 [inline]
vfs_rename+0x6f4/0xe60 fs/namei.c:-1
do_renameat2+0x8b0/0xc80 fs/namei.c:5092
__do_sys_rename fs/namei.c:5138 [inline]
__se_sys_rename fs/namei.c:5136 [inline]
__x64_sys_rename+0x86/0x90 fs/namei.c:5136
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
other info that might help us debug this:
Chain exists of:
&sb->s_type->i_mutex_key#32 --> &oi->ip_alloc_sem --> &sb->s_type->i_mutex_key#32/2
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&sb->s_type->i_mutex_key#32/2);
lock(&oi->ip_alloc_sem);
lock(&sb->s_type->i_mutex_key#32/2);
lock(&sb->s_type->i_mutex_key#32);
*** DEADLOCK ***
5 locks held by syz.6.2719/18002:
#0: ffff88804c84e418
(sb_writers#25){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:412
#1: ffff88804c84e700 (&type->s_vfs_rename_key#3){+.+.}-{3:3}, at: lock_rename fs/namei.c:3105 [inline]
#1: ffff88804c84e700 (&type->s_vfs_rename_key#3){+.+.}-{3:3}, at: do_renameat2+0x36e/0xc80 fs/namei.c:5031
#2: ffff888048995118 (&type->i_mutex_dir_key#20/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:841 [inline]
#2: ffff888048995118 (&type->i_mutex_dir_key#20/1){+.+.}-{3:3}, at: lock_two_directories fs/namei.c:-1 [inline]
#2: ffff888048995118 (&type->i_mutex_dir_key#20/1){+.+.}-{3:3}, at: lock_rename fs/namei.c:3106 [inline]
#2: ffff888048995118 (&type->i_mutex_dir_key#20/1){+.+.}-{3:3}, at: do_renameat2+0x405/0xc80 fs/namei.c:5031
#3: ffff88804d9c9818 (&sb->s_type->i_mutex_key#32/5){+.+.}-{3:3}, at: lock_rename include/linux/fs.h:-1 [inline]
#3: ffff88804d9c9818 (&sb->s_type->i_mutex_key#32/5){+.+.}-{3:3}, at: do_renameat2+0x440/0xc80 fs/namei.c:5031
#4: ffff88804d9c89d8 (&sb->s_type->i_mutex_key#32/2){+.+.}-{3:3}
, at: inode_lock_nested include/linux/fs.h:841 [inline]
, at: vfs_rename+0x65e/0xe60 fs/namei.c:4902
stack backtrace:
CPU: 0 PID: 18002 Comm: syz.6.2719 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call Trace:
<TASK>
dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
check_noncircular+0x2fc/0x400 kernel/locking/lockdep.c:2215
check_prev_add kernel/locking/lockdep.c:3162 [inline]
check_prevs_add kernel/locking/lockdep.c:3281 [inline]
validate_chain kernel/locking/lockdep.c:3897 [inline]
__lock_acquire+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171
lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790
down_write+0x97/0x200 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:806 [inline]
vfs_rename+0x6f4/0xe60 fs/namei.c:-1
do_renameat2+0x8b0/0xc80 fs/namei.c:5092
__do_sys_rename fs/namei.c:5138 [inline]
__se_sys_rename fs/namei.c:5136 [inline]
__x64_sys_rename+0x86/0x90 fs/namei.c:5136
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f1c18fa9b59
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:00007f1c19e9f028 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 00007f1c19235fa0 RCX: 00007f1c18fa9b59
RDX: 0000000000000000 RSI: 0000200000000b80 RDI: 0000200000000b40
RBP: 00007f1c1903a18b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f1c19236038 R14: 00007f1c19235fa0 R15: 00007ffcb2e67d98
</TASK>
(syz.6.2719,18002,0):ocfs2_rename:1693 ERROR: status = -39
* Struck through repros no longer work on HEAD.