possible deadlock in __ocfs2_reflink

Status: upstream: reported C repro on 2026/08/09 16:23
Reported-by: syzbot+508551fa033c2f3af4e6@syzkaller.appspotmail.com
First crash: 98d, last: 4h35m
▶ ▼ Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in __ocfs2_reflink 4 3 2d11h 12d 0/3 upstream: reported on 2026/11/03 14:55
upstream possible deadlock in __ocfs2_reflink prio:high ocfs2 4 4 109d 105d 0/29 auto-obsoleted due to no activity on 2026/11/06 07:17
linux-6.6 possible deadlock in __ocfs2_reflink 4 2 31d 31d 0/2 upstream: reported on 2026/10/15 05:17

Sample crash report:
(syz.0.17,4600,0):ocfs2_rename:1284 ERROR: status = -2
(syz.0.17,4600,0):ocfs2_rename:1691 ERROR: status = -2
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.0.17/4600 is trying to acquire lock:
ffff0000e92509c8 (&sb->s_type->i_mutex_key#22/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:799 [inline]
ffff0000e92509c8 (&sb->s_type->i_mutex_key#22/2){+.+.}-{3:3}, at: __ocfs2_reflink+0xa64/0x1338 fs/ocfs2/refcounttree.c:4202

but task is already holding lock:
ffff0000e9296a20 (&oi->ip_alloc_sem){+.+.}-{3:3}, at: ocfs2_reflink+0x484/0x84c fs/ocfs2/refcounttree.c:4300

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&oi->ip_alloc_sem){+.+.}-{3:3}:
       down_write+0x5c/0x88 kernel/locking/rwsem.c:1573
       ocfs2_reflink+0x484/0x84c fs/ocfs2/refcounttree.c:4300
       ocfs2_vfs_reflink+0x300/0x400 fs/ocfs2/refcounttree.c:4427
       ocfs2_reflink_ioctl+0x35c/0x3f0 fs/ocfs2/refcounttree.c:4467
       ocfs2_ioctl+0x884/0xb2c fs/ocfs2/ioctl.c:913
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:870 [inline]
       __se_sys_ioctl fs/ioctl.c:856 [inline]
       __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140
       do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204
       el0_svc+0x58/0x12c 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:589

-> #2 (&oi->ip_xattr_sem){+.+.}-{3:3}:
       down_write+0x5c/0x88 kernel/locking/rwsem.c:1573
       ocfs2_reflink+0x47c/0x84c fs/ocfs2/refcounttree.c:4299
       ocfs2_vfs_reflink+0x300/0x400 fs/ocfs2/refcounttree.c:4427
       ocfs2_reflink_ioctl+0x35c/0x3f0 fs/ocfs2/refcounttree.c:4467
       ocfs2_ioctl+0x884/0xb2c fs/ocfs2/ioctl.c:913
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:870 [inline]
       __se_sys_ioctl fs/ioctl.c:856 [inline]
       __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140
       do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204
       el0_svc+0x58/0x12c 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:589

-> #1 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}:
       down_write+0x5c/0x88 kernel/locking/rwsem.c:1573
       inode_lock include/linux/fs.h:764 [inline]
       vfs_rename+0x6a8/0xe3c fs/namei.c:4894
       do_renameat2+0x760/0xaa4 fs/namei.c:5082
       __do_sys_renameat2 fs/namei.c:5115 [inline]
       __se_sys_renameat2 fs/namei.c:5112 [inline]
       __arm64_sys_renameat2+0xe8/0x104 fs/namei.c:5112
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140
       do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204
       el0_svc+0x58/0x12c 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:589

-> #0 (&sb->s_type->i_mutex_key#22/2){+.+.}-{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+0x3504/0x7280 kernel/locking/lockdep.c:5171
       lock_acquire+0x210/0x63c kernel/locking/lockdep.c:5790
       down_write_nested+0x64/0x94 kernel/locking/rwsem.c:1689
       inode_lock_nested include/linux/fs.h:799 [inline]
       __ocfs2_reflink+0xa64/0x1338 fs/ocfs2/refcounttree.c:4202
       ocfs2_reflink+0x498/0x84c fs/ocfs2/refcounttree.c:4301
       ocfs2_vfs_reflink+0x300/0x400 fs/ocfs2/refcounttree.c:4427
       ocfs2_reflink_ioctl+0x35c/0x3f0 fs/ocfs2/refcounttree.c:4467
       ocfs2_ioctl+0x884/0xb2c fs/ocfs2/ioctl.c:913
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:870 [inline]
       __se_sys_ioctl fs/ioctl.c:856 [inline]
       __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140
       do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204
       el0_svc+0x58/0x12c 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:589

other info that might help us debug this:

Chain exists of:
  &sb->s_type->i_mutex_key#22/2 --> &oi->ip_xattr_sem --> &oi->ip_alloc_sem

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&oi->ip_alloc_sem);
                               lock(&oi->ip_xattr_sem);
                               lock(&oi->ip_alloc_sem);
  lock(&sb->s_type->i_mutex_key#22/2);

 *** DEADLOCK ***

5 locks held by syz.0.17/4600:
 #0: ffff0000d9b0a460 (sb_writers#12){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:402
 #1: ffff0000e93289c8 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:799 [inline]
 #1: ffff0000e93289c8 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: filename_create+0x1b0/0x3a8 fs/namei.c:3931
 #2: ffff0000e9296d88 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:764 [inline]
 #2: ffff0000e9296d88 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: ocfs2_vfs_reflink+0x2bc/0x400 fs/ocfs2/refcounttree.c:4424
 #3: ffff0000e9296ab8 (&oi->ip_xattr_sem){+.+.}-{3:3}, at: ocfs2_reflink+0x47c/0x84c fs/ocfs2/refcounttree.c:4299
 #4: ffff0000e9296a20 (&oi->ip_alloc_sem){+.+.}-{3:3}, at: ocfs2_reflink+0x484/0x84c fs/ocfs2/refcounttree.c:4300

stack backtrace:
CPU: 0 PID: 4600 Comm: syz.0.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call trace:
 dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack+0x30/0x40 lib/dump_stack.c:88
 dump_stack_lvl+0xf4/0x15c lib/dump_stack.c:106
 dump_stack+0x1c/0x5c lib/dump_stack.c:113
 print_circular_bug+0x148/0x1b0 kernel/locking/lockdep.c:2088
 check_noncircular+0x290/0x370 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+0x3504/0x7280 kernel/locking/lockdep.c:5171
 lock_acquire+0x210/0x63c kernel/locking/lockdep.c:5790
 down_write_nested+0x64/0x94 kernel/locking/rwsem.c:1689
 inode_lock_nested include/linux/fs.h:799 [inline]
 __ocfs2_reflink+0xa64/0x1338 fs/ocfs2/refcounttree.c:4202
 ocfs2_reflink+0x498/0x84c fs/ocfs2/refcounttree.c:4301
 ocfs2_vfs_reflink+0x300/0x400 fs/ocfs2/refcounttree.c:4427
 ocfs2_reflink_ioctl+0x35c/0x3f0 fs/ocfs2/refcounttree.c:4467
 ocfs2_ioctl+0x884/0xb2c fs/ocfs2/ioctl.c:913
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204
 el0_svc+0x58/0x12c 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:589

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/15 15:57 linux-6.1.y c75b0cf0982c 819ebe34 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (clean fs)] ci2-linux-6-1-kasan-arm64 possible deadlock in __ocfs2_reflink
2026/11/15 14:17 linux-6.1.y c75b0cf0982c 819ebe34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in __ocfs2_reflink
2026/10/16 14:31 linux-6.1.y 79807e970724 4c840a2f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in __ocfs2_reflink
2026/08/18 02:37 linux-6.1.y e4f7d8be268e 1e72964b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in __ocfs2_reflink
2026/08/09 16:22 linux-6.1.y e4f7d8be268e 5d63f80b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in __ocfs2_reflink
* Struck through repros no longer work on HEAD.