syzbot
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: 10h31m, last: 10h31m
Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.2.1042/7661 is trying to acquire lock:
ffff8880519b0660 (&oi->ip_alloc_sem/1){+.+.}-{3:3}, at: ocfs2_xattr_set_handle+0x3f9/0x820 fs/ocfs2/xattr.c:3591
but task is already holding lock:
ffff8880543994e8 (&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_openat fs/open.c:1352 [inline]
__se_sys_openat fs/open.c:1347 [inline]
__x64_sys_openat+0x135/0x160 fs/open.c:1347
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#6){.+.+}-{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 (&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+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:
&oi->ip_alloc_sem/1 --> sb_internal#6 --> &journal->j_trans_barrier
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
rlock(&journal->j_trans_barrier);
lock(sb_internal#6);
lock(&journal->j_trans_barrier);
lock(&oi->ip_alloc_sem/1);
*** DEADLOCK ***
8 locks held by syz.2.1042/7661:
#0: ffff8880736de460 (sb_writers#38){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:402
#1: ffff888051abd108 (&type->i_mutex_dir_key#22/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:801 [inline]
#1: ffff888051abd108 (&type->i_mutex_dir_key#22/1){+.+.}-{3:3}, at: filename_create+0x20b/0x450 fs/namei.c:3931
#2: ffff888051b32648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:766 [inline]
#2: ffff888051b32648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x16a/0x4810 fs/ocfs2/suballoc.c:804
#3: ffff888051b31808 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:766 [inline]
#3: ffff888051b31808 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x16a/0x4810 fs/ocfs2/suballoc.c:804
#4: ffff888051b342c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:766 [inline]
#4: ffff888051b342c8 (&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: ffff8880736de650 (sb_internal#6){.+.+}-{0:0}, at: ocfs2_mknod+0x1265/0x2500 fs/ocfs2/namei.c:360
#6: ffff8880543994e8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a4/0x6f0 fs/ocfs2/journal.c:384
#7: ffff888056396990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x2014/0x2240 fs/jbd2/transaction.c:463
stack backtrace:
CPU: 0 PID: 7661 Comm: syz.2.1042 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:0x7f130fda8387
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:00007f130dfb3e58 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007f130dfb3ee0 RCX: 00007f130fda8387
RDX: 00000000000001ff RSI: 0000200000000080 RDI: 00000000ffffff9c
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000000080
R13: 00007f130dfb3ea0 R14: 0000000000000000 R15: 0000000000000000
</TASK>
* Struck through repros no longer work on HEAD.