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: 4d10h, last: 4d10h
✨ AI Jobs (1)
ID Workflow Result Correct Bug Created Started Finished Revision
b7f75b7b assessment-security DenialOfService: ❌ Exploitable: ❌ FilesystemTrigger: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ✅ UserNamespace: ✅ VMGuestTrigger: ❌ VMHostTrigger: ❌ possible deadlock in vfs_rename (3) 2026/09/21 00:02 2026/09/21 00:02 2026/09/21 00:49 853b104b
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [ocfs2?] possible deadlock in vfs_rename (3) 0 (1) 2026/09/23 18:33
Similar bugs (7)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in vfs_rename 4 13 555d 869d 0/3 auto-obsoleted due to no activity on 2025/06/25 12:29
upstream possible deadlock in vfs_rename kernel 4 1 1324d 1324d 0/29 closed as invalid on 2023/02/08 16:28
linux-6.1 possible deadlock in vfs_rename (2) origin:lts-only 4 syz, C inconclusive 25 11d 632d 0/3 upstream: reported C repro on 2024/12/31 00:31
linux-5.15 possible deadlock in vfs_rename (2) 4 1 414d 414d 0/3 auto-obsoleted due to no activity on 2025/11/13 14:59
linux-6.1 possible deadlock in vfs_rename 4 8 737d 772d 0/3 auto-obsoleted due to no activity on 2024/12/25 19:29
linux-6.6 possible deadlock in vfs_rename 4 1 311d 311d 0/2 auto-obsoleted due to no activity on 2026/02/24 07:36
upstream possible deadlock in vfs_rename (2) ntfs3 4 3 614d 663d 0/29 auto-obsoleted due to no activity on 2025/04/27 15:12

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

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/09/19 18:24 upstream 40288c9206c1 853b104b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in vfs_rename
2026/09/19 18:24 upstream 40288c9206c1 853b104b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in vfs_rename
* Struck through repros no longer work on HEAD.