syzbot
possible deadlock in ocfs2_calc_xattr_init
Status:
auto-obsoleted due to no activity on 2026/07/15 12:36
Reported-by: syzbot+5d1d7d9196ade07c7f4e@syzkaller.appspotmail.com
First crash: 398d, last: 131d
Sample crash report:
(syz.2.1274,9977,1):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.1274/9977 is trying to acquire lock:
ffff8880594edc78 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_calc_xattr_init+0x208/0xd90 fs/ocfs2/xattr.c:627
but task is already holding lock:
ffff88805d4db498 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
ffff88805d4db498 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x16e/0x44c0 fs/ocfs2/suballoc.c:782
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #3 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}:
down_write+0x97/0x200 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:804 [inline]
ocfs2_remove_inode fs/ocfs2/inode.c:655 [inline]
ocfs2_wipe_inode fs/ocfs2/inode.c:818 [inline]
ocfs2_delete_inode fs/ocfs2/inode.c:1079 [inline]
ocfs2_evict_inode+0x1d84/0x41e0 fs/ocfs2/inode.c:1219
evict+0x4ca/0x8d0 fs/inode.c:705
ocfs2_dentry_iput+0x24e/0x390 fs/ocfs2/dcache.c:418
__dentry_kill+0x431/0x650 fs/dcache.c:611
dentry_kill+0xb8/0x290 fs/dcache.c:-1
dput+0xfe/0x1e0 fs/dcache.c:918
__fput+0x5e5/0x970 fs/file_table.c:392
task_work_run+0x1d4/0x260 kernel/task_work.c:245
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210
__syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:302
do_syscall_64+0x61/0xa0 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x68/0xd2
-> #2 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}:
down_write+0x97/0x200 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:804 [inline]
ocfs2_del_inode_from_orphan+0x12f/0x7a0 fs/ocfs2/namei.c:2716
ocfs2_dio_end_io_write fs/ocfs2/aops.c:2333 [inline]
ocfs2_dio_end_io+0x546/0x1200 fs/ocfs2/aops.c:2431
dio_complete+0x254/0x710 fs/direct-io.c:282
__blockdev_direct_IO+0x2ea8/0x3500 fs/direct-io.c:1308
ocfs2_direct_IO+0x235/0x2a0 fs/ocfs2/aops.c:2468
generic_file_direct_write+0x1d4/0x3e0 mm/filemap.c:3956
__generic_file_write_iter+0x11b/0x230 mm/filemap.c:4112
ocfs2_file_write_iter+0x167a/0x1e80 fs/ocfs2/file.c:2468
do_iter_readv_writev fs/read_write.c:-1 [inline]
do_iter_write+0x738/0xc30 fs/read_write.c:860
iter_file_splice_write+0x6a3/0xcb0 fs/splice.c:736
do_splice_from fs/splice.c:933 [inline]
direct_splice_actor+0xe8/0x130 fs/splice.c:1142
splice_direct_to_actor+0x304/0x8c0 fs/splice.c:1088
do_splice_direct+0x1d5/0x2f0 fs/splice.c:1194
do_sendfile+0x5f2/0xef0 fs/read_write.c:1254
__do_sys_sendfile64 fs/read_write.c:1322 [inline]
__se_sys_sendfile64+0x145/0x1a0 fs/read_write.c:1308
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
-> #1 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}:
down_write+0x97/0x200 kernel/locking/rwsem.c:1573
ocfs2_try_remove_refcount_tree+0xb7/0x340 fs/ocfs2/refcounttree.c:932
ocfs2_truncate_file+0xde5/0x1440 fs/ocfs2/file.c:521
ocfs2_setattr+0x158d/0x1bc0 fs/ocfs2/file.c:1211
notify_change+0xb0d/0xe10 fs/attr.c:499
do_truncate+0x1b0/0x240 fs/open.c:66
handle_truncate fs/namei.c:3299 [inline]
do_open fs/namei.c:3644 [inline]
path_openat+0x2a32/0x3230 fs/namei.c:3797
do_filp_open+0x1f5/0x430 fs/namei.c:3824
do_sys_openat2+0x134/0x1d0 fs/open.c:1421
do_sys_open fs/open.c:1436 [inline]
__do_sys_openat fs/open.c:1452 [inline]
__se_sys_openat fs/open.c:1447 [inline]
__x64_sys_openat+0x139/0x160 fs/open.c:1447
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
-> #0 (&oi->ip_xattr_sem){++++}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x2df1/0x7d40 kernel/locking/lockdep.c:5137
lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754
down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520
ocfs2_calc_xattr_init+0x208/0xd90 fs/ocfs2/xattr.c:627
ocfs2_mknod+0xcfd/0x2300 fs/ocfs2/namei.c:330
ocfs2_mkdir+0x196/0x430 fs/ocfs2/namei.c:657
vfs_mkdir+0x296/0x440 fs/namei.c:4121
do_mkdirat+0x1dc/0x450 fs/namei.c:4144
__do_sys_mkdirat fs/namei.c:4159 [inline]
__se_sys_mkdirat fs/namei.c:4157 [inline]
__x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4157
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/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_xattr_sem --> &ocfs2_sysfile_lock_key[args->fi_sysfile_type] --> &ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4);
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]);
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4);
rlock(&oi->ip_xattr_sem);
*** DEADLOCK ***
3 locks held by syz.2.1274/9977:
#0: ffff888066c0a418 (sb_writers#17){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:412
#1: ffff8880594edf58 (&type->i_mutex_dir_key#12/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:839 [inline]
#1: ffff8880594edf58 (&type->i_mutex_dir_key#12/1){+.+.}-{3:3}, at: filename_create+0x20c/0x480 fs/namei.c:3890
#2: ffff88805d4db498 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
#2: ffff88805d4db498 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x16e/0x44c0 fs/ocfs2/suballoc.c:782
stack backtrace:
CPU: 1 PID: 9977 Comm: syz.2.1274 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/18/2026
Call Trace:
<TASK>
dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
check_noncircular+0x2fc/0x400 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x2df1/0x7d40 kernel/locking/lockdep.c:5137
lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754
down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520
ocfs2_calc_xattr_init+0x208/0xd90 fs/ocfs2/xattr.c:627
ocfs2_mknod+0xcfd/0x2300 fs/ocfs2/namei.c:330
ocfs2_mkdir+0x196/0x430 fs/ocfs2/namei.c:657
vfs_mkdir+0x296/0x440 fs/namei.c:4121
do_mkdirat+0x1dc/0x450 fs/namei.c:4144
__do_sys_mkdirat fs/namei.c:4159 [inline]
__se_sys_mkdirat fs/namei.c:4157 [inline]
__x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4157
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7ff72979b687
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:00007ff72a5c0e58 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007ff72a5c0ee0 RCX: 00007ff72979b687
RDX: 00000000000001ff RSI: 0000200000000100 RDI: 00000000ffffff9c
RBP: 00002000000002c0 R08: 0000200000000080 R09: 0000000000000000
R10: 00002000000002c0 R11: 0000000000000246 R12: 0000200000000100
R13: 00007ff72a5c0ea0 R14: 0000000000000000 R15: 0000000000000000
</TASK>
* Struck through repros no longer work on HEAD.