possible deadlock in ocfs2_xattr_ibody_find (2)

Status: upstream: reported on 2026/08/05 03:00
Reported-by: syzbot+c1cda62472c39659d365@syzkaller.appspotmail.com
First crash: 3d08h, last: 3d08h
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in ocfs2_xattr_ibody_find ocfs2 4 syz, C inconclusive done 49 461d 614d 0/29 auto-obsoleted due to no activity on 2025/07/12 21:15
upstream possible deadlock in ocfs2_xattr_ibody_find (2) ocfs2 4 912 186d 351d 0/29 auto-obsoleted due to no activity on 2026/04/14 03:24
linux-6.1 possible deadlock in ocfs2_xattr_ibody_find 4 4 351d 353d 0/3 auto-obsoleted due to no activity on 2025/11/30 10:09

Sample crash report:
ocfs2: Mounting device (7,1) on (node local, slot 0) with ordered data mode.
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.1.5892/17456 is trying to acquire lock:
ffff0000f8dd6a20 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_xattr_ibody_find+0x108/0x664 fs/ocfs2/xattr.c:2693

but task is already holding lock:
ffff0000f8dd6ab8 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_xattr_set+0x348/0xf0c fs/ocfs2/xattr.c:3587

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&oi->ip_xattr_sem){++++}-{3:3}:
       down_read+0x64/0x300 kernel/locking/rwsem.c:1520
       ocfs2_init_acl+0x264/0x61c fs/ocfs2/acl.c:365
       ocfs2_mknod+0x12b0/0x218c fs/ocfs2/namei.c:410
       vfs_mknod+0x3c4/0x44c fs/namei.c:3993
       do_mknodat+0x324/0x558 fs/namei.c:-1
       __do_sys_mknodat fs/namei.c:4071 [inline]
       __se_sys_mknodat fs/namei.c:4068 [inline]
       __arm64_sys_mknodat+0xb4/0xd0 fs/namei.c:4068
       __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/0x128 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:585

-> #2 (&journal->j_trans_barrier){.+.+}-{3:3}:
       down_read+0x64/0x300 kernel/locking/rwsem.c:1520
       ocfs2_start_trans+0x38c/0x6f4 fs/ocfs2/journal.c:374
       ocfs2_modify_bh+0xd8/0x44c fs/ocfs2/quota_local.c:101
       ocfs2_local_read_info+0x1054/0x13c4 fs/ocfs2/quota_local.c:764
       dquot_load_quota_sb+0x68c/0x998 fs/quota/dquot.c:2495
       dquot_load_quota_inode+0x274/0x4dc fs/quota/dquot.c:2532
       ocfs2_enable_quotas+0x17c/0x3c4 fs/ocfs2/super.c:926
       ocfs2_fill_super+0x32f8/0x417c fs/ocfs2/super.c:1139
       mount_bdev+0x264/0x35c fs/super.c:1443
       ocfs2_mount+0x44/0x58 fs/ocfs2/super.c:1186
       legacy_get_tree+0xd8/0x174 fs/fs_context.c:632
       vfs_get_tree+0x90/0x278 fs/super.c:1573
       do_new_mount+0x228/0x804 fs/namespace.c:3078
       path_mount+0x5ac/0xe6c fs/namespace.c:3408
       do_mount fs/namespace.c:3421 [inline]
       __do_sys_mount fs/namespace.c:3629 [inline]
       __se_sys_mount fs/namespace.c:3606 [inline]
       __arm64_sys_mount+0x4a0/0x5a0 fs/namespace.c:3606
       __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/0x128 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:585

-> #1 (sb_internal#4){.+.+}-{0:0}:
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1891 [inline]
       sb_start_intwrite include/linux/fs.h:2013 [inline]
       ocfs2_start_trans+0x20c/0x6f4 fs/ocfs2/journal.c:372
       ocfs2_setattr+0xe68/0x1950 fs/ocfs2/file.c:1251
       notify_change+0xb5c/0xe20 fs/attr.c:499
       chown_common+0x430/0x59c fs/open.c:736
       vfs_fchown fs/open.c:804 [inline]
       ksys_fchown+0xe0/0x158 fs/open.c:815
       __do_sys_fchown fs/open.c:823 [inline]
       __se_sys_fchown fs/open.c:821 [inline]
       __arm64_sys_fchown+0x7c/0x94 fs/open.c:821
       __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/0x128 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:585

-> #0 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3095 [inline]
       check_prevs_add kernel/locking/lockdep.c:3214 [inline]
       validate_chain kernel/locking/lockdep.c:3830 [inline]
       __lock_acquire+0x2808/0x6634 kernel/locking/lockdep.c:5063
       lock_acquire+0x20c/0x638 kernel/locking/lockdep.c:5676
       down_read+0x64/0x300 kernel/locking/rwsem.c:1520
       ocfs2_xattr_ibody_find+0x108/0x664 fs/ocfs2/xattr.c:2693
       ocfs2_xattr_set+0x35c/0xf0c fs/ocfs2/xattr.c:3592
       ocfs2_xattr_user_set+0xc0/0xe8 fs/ocfs2/xattr.c:7389
       __vfs_setxattr+0x374/0x390 fs/xattr.c:182
       __vfs_setxattr_noperm+0x120/0x56c fs/xattr.c:216
       __vfs_setxattr_locked+0x1e8/0x214 fs/xattr.c:277
       vfs_setxattr+0x158/0x2a8 fs/xattr.c:309
       do_setxattr fs/xattr.c:594 [inline]
       setxattr+0x258/0x2d8 fs/xattr.c:617
       path_setxattr+0x130/0x260 fs/xattr.c:636
       __do_sys_setxattr fs/xattr.c:652 [inline]
       __se_sys_setxattr fs/xattr.c:648 [inline]
       __arm64_sys_setxattr+0xc4/0xe0 fs/xattr.c:648
       __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/0x128 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:585

other info that might help us debug this:

Chain exists of:
  &ocfs2_file_ip_alloc_sem_key --> &journal->j_trans_barrier --> &oi->ip_xattr_sem

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&oi->ip_xattr_sem);
                               lock(&journal->j_trans_barrier);
                               lock(&oi->ip_xattr_sem);
  lock(&ocfs2_file_ip_alloc_sem_key);

 *** DEADLOCK ***

3 locks held by syz.1.5892/17456:
 #0: ffff0000d3d7e460 (sb_writers#31){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:402
 #1: ffff0000f8dd6d88 (&type->i_mutex_dir_key#24){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
 #1: ffff0000f8dd6d88 (&type->i_mutex_dir_key#24){+.+.}-{3:3}, at: vfs_setxattr+0x138/0x2a8 fs/xattr.c:308
 #2: ffff0000f8dd6ab8 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_xattr_set+0x348/0xf0c fs/ocfs2/xattr.c:3587

stack backtrace:
CPU: 0 PID: 17456 Comm: syz.1.5892 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/02/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:2048
 check_noncircular+0x264/0x2f8 kernel/locking/lockdep.c:2170
 check_prev_add kernel/locking/lockdep.c:3095 [inline]
 check_prevs_add kernel/locking/lockdep.c:3214 [inline]
 validate_chain kernel/locking/lockdep.c:3830 [inline]
 __lock_acquire+0x2808/0x6634 kernel/locking/lockdep.c:5063
 lock_acquire+0x20c/0x638 kernel/locking/lockdep.c:5676
 down_read+0x64/0x300 kernel/locking/rwsem.c:1520
 ocfs2_xattr_ibody_find+0x108/0x664 fs/ocfs2/xattr.c:2693
 ocfs2_xattr_set+0x35c/0xf0c fs/ocfs2/xattr.c:3592
 ocfs2_xattr_user_set+0xc0/0xe8 fs/ocfs2/xattr.c:7389
 __vfs_setxattr+0x374/0x390 fs/xattr.c:182
 __vfs_setxattr_noperm+0x120/0x56c fs/xattr.c:216
 __vfs_setxattr_locked+0x1e8/0x214 fs/xattr.c:277
 vfs_setxattr+0x158/0x2a8 fs/xattr.c:309
 do_setxattr fs/xattr.c:594 [inline]
 setxattr+0x258/0x2d8 fs/xattr.c:617
 path_setxattr+0x130/0x260 fs/xattr.c:636
 __do_sys_setxattr fs/xattr.c:652 [inline]
 __se_sys_setxattr fs/xattr.c:648 [inline]
 __arm64_sys_setxattr+0xc4/0xe0 fs/xattr.c:648
 __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/0x128 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:585

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/05 02:59 linux-6.1.y fb28aa725e05 52aa2820 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_ibody_find
2026/08/05 02:59 linux-6.1.y fb28aa725e05 52aa2820 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ocfs2_xattr_ibody_find
* Struck through repros no longer work on HEAD.