possible deadlock in ocfs2_xattr_set_handle

Status: upstream: reported on 2026/11/23 15:06
Reported-by: syzbot+7e141c2fa1f396f29443@syzkaller.appspotmail.com
First crash: 6d22h, last: 3d12h
▶ ▼ Similar bugs (3)
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 4d04h 4d04h 0/3 upstream: reported on 2026/11/26 09:32
upstream possible deadlock in ocfs2_xattr_set_handle (2) prio:high ocfs2 4 done 37 1d08h 46d 0/30 upstream: reported on 2026/10/15 07:48
upstream possible deadlock in ocfs2_xattr_set_handle ocfs2 4 syz, C 2441 296d 802d 0/30 auto-obsoleted due to no activity on 2026/07/11 17:22

Sample crash report:
(syz.2.359,5468,0):ocfs2_block_check_validate:402 ERROR: CRC32 failed: stored: 0xb3775c19, computed 0x2dd1c265. Applying ECC.
JBD2: Ignoring recovery information on journal
ocfs2: Mounting device (7,2) on (node local, slot 0) with ordered data mode.
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.2.359/5468 is trying to acquire lock:
ffff8880514214a0 (&ocfs2_file_ip_alloc_sem_key/1){+.+.}-{3:3}, at: ocfs2_xattr_set_handle+0x3f9/0x820 fs/ocfs2/xattr.c:3591

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

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+0x42/0x2d0 kernel/locking/rwsem.c:1520
       ocfs2_start_trans+0x3a4/0x6f0 fs/ocfs2/journal.c:384
       ocfs2_mknod+0x1265/0x2500 fs/ocfs2/namei.c:360
       ocfs2_create+0x1b6/0x4b0 fs/ocfs2/namei.c:675
       lookup_open fs/namei.c:3533 [inline]
       open_last_lookups fs/namei.c:3601 [inline]
       path_openat+0x11b9/0x2f10 fs/namei.c:3835
       do_filp_open+0x1ee/0x420 fs/namei.c:3865
       do_sys_openat2+0x14b/0x4f0 fs/open.c:1320
       do_sys_open fs/open.c:1336 [inline]
       __do_sys_open fs/open.c:1344 [inline]
       __se_sys_open fs/open.c:1340 [inline]
       __x64_sys_open+0x11b/0x140 fs/open.c:1340
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #1 (sb_internal#3){.+.+}-{0:0}:
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1899 [inline]
       sb_start_intwrite include/linux/fs.h:2021 [inline]
       ocfs2_start_trans+0x2a5/0x6f0 fs/ocfs2/journal.c:382
       ocfs2_duplicate_inline_data+0x167/0x560 fs/ocfs2/refcounttree.c:3968
       ocfs2_reflink_remap_blocks+0x4a7/0x1ab0 fs/ocfs2/refcounttree.c:4661
       ocfs2_remap_file_range+0x4a7/0x740 fs/ocfs2/file.c:2733
       vfs_copy_file_range+0xd89/0x1520 fs/read_write.c:1520
       __do_sys_copy_file_range fs/read_write.c:1598 [inline]
       __se_sys_copy_file_range+0x320/0x470 fs/read_write.c:1561
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&ocfs2_file_ip_alloc_sem_key/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+0x3a03/0x7ea0 kernel/locking/lockdep.c:5171
       lock_acquire+0x1bc/0x4a0 kernel/locking/lockdep.c:5790
       down_write_nested+0x39/0x60 kernel/locking/rwsem.c:1689
       ocfs2_xattr_set_handle+0x3f9/0x820 fs/ocfs2/xattr.c:3591
       ocfs2_set_acl+0x4a5/0x580 fs/ocfs2/acl.c:249
       ocfs2_init_acl+0x1f7/0x420 fs/ocfs2/acl.c:426
       ocfs2_mknod+0x1869/0x2500 fs/ocfs2/namei.c:409
       ocfs2_mkdir+0x1b6/0x4b0 fs/ocfs2/namei.c:658
       vfs_mkdir+0x386/0x570 fs/namei.c:4161
       do_mkdirat+0x1d8/0x440 fs/namei.c:4186
       __do_sys_mkdirat fs/namei.c:4201 [inline]
       __se_sys_mkdirat fs/namei.c:4199 [inline]
       __x64_sys_mkdirat+0x85/0x90 fs/namei.c:4199
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

Chain exists of:
  &ocfs2_file_ip_alloc_sem_key/1 --> sb_internal#3 --> &journal->j_trans_barrier

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  rlock(&journal->j_trans_barrier);
                               lock(sb_internal#3);
                               lock(&journal->j_trans_barrier);
  lock(&ocfs2_file_ip_alloc_sem_key/1);

 *** DEADLOCK ***

8 locks held by syz.2.359/5468:
 #0: ffff888077d4c460 (sb_writers#15){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:402
 #1: ffff888073ebc2c8 (&type->i_mutex_dir_key#10/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:801 [inline]
 #1: ffff888073ebc2c8 (&type->i_mutex_dir_key#10/1){+.+.}-{3:3}, at: filename_create+0x20b/0x450 fs/namei.c:3931
 #2: ffff88805142b488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:766 [inline]
 #2: ffff88805142b488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x16a/0x4810 fs/ocfs2/suballoc.c:804
 #3: ffff88805142a648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:766 [inline]
 #3: ffff88805142a648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x16a/0x4810 fs/ocfs2/suballoc.c:804
 #4: ffff888073ff3488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:766 [inline]
 #4: ffff888073ff3488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: ocfs2_reserve_local_alloc_bits+0x11e/0x2770 fs/ocfs2/localalloc.c:635
 #5: ffff888077d4c650 (sb_internal#3){.+.+}-{0:0}, at: ocfs2_mknod+0x1265/0x2500 fs/ocfs2/namei.c:360
 #6: ffff8880578030e8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a4/0x6f0 fs/ocfs2/journal.c:384
 #7: ffff88807abe0990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x2014/0x2240 fs/jbd2/transaction.c:463

stack backtrace:
CPU: 0 PID: 5468 Comm: syz.2.359 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
 check_noncircular+0x2f8/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+0x3a03/0x7ea0 kernel/locking/lockdep.c:5171
 lock_acquire+0x1bc/0x4a0 kernel/locking/lockdep.c:5790
 down_write_nested+0x39/0x60 kernel/locking/rwsem.c:1689
 ocfs2_xattr_set_handle+0x3f9/0x820 fs/ocfs2/xattr.c:3591
 ocfs2_set_acl+0x4a5/0x580 fs/ocfs2/acl.c:249
 ocfs2_init_acl+0x1f7/0x420 fs/ocfs2/acl.c:426
 ocfs2_mknod+0x1869/0x2500 fs/ocfs2/namei.c:409
 ocfs2_mkdir+0x1b6/0x4b0 fs/ocfs2/namei.c:658
 vfs_mkdir+0x386/0x570 fs/namei.c:4161
 do_mkdirat+0x1d8/0x440 fs/namei.c:4186
 __do_sys_mkdirat fs/namei.c:4201 [inline]
 __se_sys_mkdirat fs/namei.c:4199 [inline]
 __x64_sys_mkdirat+0x85/0x90 fs/namei.c:4199
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f393d1a8907
Code: 00 66 90 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 db f7 ff ff 66 2e 0f 1f 84 00 00 00 00 00 90 b8 02 01 00 00 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:00007f393df9ce58 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007f393df9cee0 RCX: 00007f393d1a8907
RDX: 00000000000001ff RSI: 0000200000000000 RDI: 00000000ffffff9c
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000000000
R13: 00007f393df9cea0 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/26 04:22 linux-6.1.y 1ca1436ccc68 9a575fe5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set_handle
2026/11/24 15:55 linux-6.1.y 1ca1436ccc68 50451a16 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set_handle
2026/11/24 15:54 linux-6.1.y 1ca1436ccc68 50451a16 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set_handle
2026/11/23 15:06 linux-6.1.y 1ca1436ccc68 e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ocfs2_xattr_set_handle
2026/11/27 01:22 linux-6.1.y 1ca1436ccc68 f1f6b8bf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set_handle
2026/11/26 08:39 linux-6.1.y 1ca1436ccc68 9a575fe5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set_handle
2026/11/26 08:39 linux-6.1.y 1ca1436ccc68 9a575fe5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_set_handle
* Struck through repros no longer work on HEAD.