possible deadlock in ocfs2_xattr_set_handle

Status: upstream: reported on 2026/12/01 12:30
Reported-by: syzbot+5e2b9e8b9d93a1a0e95a@syzkaller.appspotmail.com
First crash: 11h32m, last: 11h31m
▶ ▼ Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in ocfs2_xattr_set_handle 4 1 5d14h 5d14h 0/3 upstream: reported on 2026/11/26 09:32
linux-6.1 possible deadlock in ocfs2_xattr_set_handle 4 7 4d22h 8d08h 0/3 upstream: reported on 2026/11/23 15:06
upstream possible deadlock in ocfs2_xattr_set_handle (2) prio:high ocfs2 4 done 38 1d06h 47d 0/30 upstream: reported on 2026/10/15 07:48
upstream possible deadlock in ocfs2_xattr_set_handle ocfs2 4 syz, C 2441 297d 804d 0/30 auto-obsoleted due to no activity on 2026/07/11 17:22

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.2.478/7251 is trying to acquire lock:
ffff88805c360660 (&oi->ip_alloc_sem/1){+.+.}-{3:3}, at: ocfs2_xattr_set_handle+0x3fd/0x820 fs/ocfs2/xattr.c:3839

but task is already holding lock:
ffff88805d8684e8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a8/0x6f0 fs/ocfs2/journal.c:382

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&journal->j_trans_barrier){.+.+}-{3:3}:
       down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520
       ocfs2_start_trans+0x3a8/0x6f0 fs/ocfs2/journal.c:382
       ocfs2_mknod+0xef1/0x2250 fs/ocfs2/namei.c:360
       ocfs2_create+0x196/0x430 fs/ocfs2/namei.c:675
       lookup_open fs/namei.c:3551 [inline]
       open_last_lookups fs/namei.c:3619 [inline]
       path_openat+0x1705/0x3270 fs/namei.c:3853
       do_filp_open+0x1f2/0x430 fs/namei.c:3883
       do_sys_openat2+0x134/0x1d0 fs/open.c:1422
       do_sys_open fs/open.c:1437 [inline]
       __do_sys_open fs/open.c:1445 [inline]
       __se_sys_open fs/open.c:1441 [inline]
       __x64_sys_open+0x11f/0x140 fs/open.c:1441
       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 (sb_internal#2){.+.+}-{0:0}:
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1636 [inline]
       sb_start_intwrite include/linux/fs.h:1758 [inline]
       ocfs2_start_trans+0x2a9/0x6f0 fs/ocfs2/journal.c:380
       ocfs2_duplicate_inline_data+0x16b/0x560 fs/ocfs2/refcounttree.c:3969
       ocfs2_reflink_remap_blocks+0x4ab/0x1ab0 fs/ocfs2/refcounttree.c:4662
       ocfs2_remap_file_range+0x4b1/0x740 fs/ocfs2/file.c:2775
       vfs_copy_file_range+0xdc9/0x15a0 fs/read_write.c:1519
       __do_sys_copy_file_range fs/read_write.c:1597 [inline]
       __se_sys_copy_file_range+0x324/0x470 fs/read_write.c:1560
       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 (&oi->ip_alloc_sem/1){+.+.}-{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_nested+0x9e/0x200 kernel/locking/rwsem.c:1689
       ocfs2_xattr_set_handle+0x3fd/0x820 fs/ocfs2/xattr.c:3839
       ocfs2_set_acl+0x4a5/0x580 fs/ocfs2/acl.c:249
       ocfs2_init_acl+0x1fb/0x420 fs/ocfs2/acl.c:427
       ocfs2_mknod+0x1373/0x2250 fs/ocfs2/namei.c:409
       ocfs2_mkdir+0x196/0x430 fs/ocfs2/namei.c:658
       vfs_mkdir+0x2a5/0x470 fs/namei.c:4180
       do_mkdirat+0x1dc/0x450 fs/namei.c:4203
       __do_sys_mkdirat fs/namei.c:4218 [inline]
       __se_sys_mkdirat fs/namei.c:4216 [inline]
       __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4216
       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:
  &oi->ip_alloc_sem/1 --> sb_internal#2 --> &journal->j_trans_barrier

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  rlock(&journal->j_trans_barrier);
                               lock(sb_internal#2);
                               lock(&journal->j_trans_barrier);
  lock(&oi->ip_alloc_sem/1);

 *** DEADLOCK ***

8 locks held by syz.2.478/7251:
 #0: ffff8880330f4418 (sb_writers#14){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:412
 #1: ffff88805f2b1818 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:841 [inline]
 #1: ffff88805f2b1818 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: filename_create+0x20f/0x450 fs/namei.c:3949
 #2: ffff88805c35a658 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:806 [inline]
 #2: ffff88805c35a658 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x171/0x44a0 fs/ocfs2/suballoc.c:804
 #3: ffff88805c359818 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:806 [inline]
 #3: ffff88805c359818 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x171/0x44a0 fs/ocfs2/suballoc.c:804
 #4: ffff88805c35c2d8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:806 [inline]
 #4: ffff88805c35c2d8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: ocfs2_reserve_local_alloc_bits+0x120/0x2620 fs/ocfs2/localalloc.c:635
 #5: ffff8880330f4608 (sb_internal#2){.+.+}-{0:0}, at: ocfs2_mknod+0xef1/0x2250 fs/ocfs2/namei.c:360
 #6: ffff88805d8684e8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a8/0x6f0 fs/ocfs2/journal.c:382
 #7: ffff88805e970990 (jbd2_handle#2){.+.+}-{0:0}, at: start_this_handle+0x1f3f/0x2170 fs/jbd2/transaction.c:448

stack backtrace:
CPU: 0 PID: 7251 Comm: syz.2.478 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_nested+0x9e/0x200 kernel/locking/rwsem.c:1689
 ocfs2_xattr_set_handle+0x3fd/0x820 fs/ocfs2/xattr.c:3839
 ocfs2_set_acl+0x4a5/0x580 fs/ocfs2/acl.c:249
 ocfs2_init_acl+0x1fb/0x420 fs/ocfs2/acl.c:427
 ocfs2_mknod+0x1373/0x2250 fs/ocfs2/namei.c:409
 ocfs2_mkdir+0x196/0x430 fs/ocfs2/namei.c:658
 vfs_mkdir+0x2a5/0x470 fs/namei.c:4180
 do_mkdirat+0x1dc/0x450 fs/namei.c:4203
 __do_sys_mkdirat fs/namei.c:4218 [inline]
 __se_sys_mkdirat fs/namei.c:4216 [inline]
 __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4216
 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:0x7ff95eda9c99
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:00007ff95cff6028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007ff95f036098 RCX: 00007ff95eda9c99
RDX: 00000000000001ff RSI: 0000200000004cc0 RDI: ffffffffffffff9c
RBP: 00007ff95ee3b18b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ff95f036130 R14: 00007ff95f036098 R15: 00007ffc9b046cd8
 </TASK>

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/12/01 12:30 linux-6.6.y e2bb30811e06 a6d1ba3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in ocfs2_xattr_set_handle
2026/12/01 12:30 linux-6.6.y e2bb30811e06 a6d1ba3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in ocfs2_xattr_set_handle
* Struck through repros no longer work on HEAD.