ocfs2: Mounting device (7,6) on (node local, slot 0) with ordered data mode.
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.6.277/6015 is trying to acquire lock:
ffff8880555e1538 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_init_acl+0x307/0x770 fs/ocfs2/acl.c:365
but task is already holding lock:
ffff88805f0e8ce8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a4/0x6f0 fs/ocfs2/journal.c:374
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #4 (&journal->j_trans_barrier){.+.+}-{3:3}:
down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520
ocfs2_start_trans+0x3a4/0x6f0 fs/ocfs2/journal.c:374
ocfs2_mknod+0x1273/0x2580 fs/ocfs2/namei.c:361
ocfs2_create+0x1b6/0x4b0 fs/ocfs2/namei.c:674
lookup_open fs/namei.c:3533 [inline]
open_last_lookups fs/namei.c:3601 [inline]
path_openat+0x11b9/0x2f10 fs/namei.c:3831
do_filp_open+0x1ee/0x420 fs/namei.c:3861
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
-> #3 (sb_internal#5){.+.+}-{0:0}:
percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
__sb_start_write include/linux/fs.h:1897 [inline]
sb_start_intwrite include/linux/fs.h:2019 [inline]
ocfs2_start_trans+0x2a5/0x6f0 fs/ocfs2/journal.c:372
ocfs2_create_refcount_tree+0x368/0x1370 fs/ocfs2/refcounttree.c:577
ocfs2_attach_refcount_tree fs/ocfs2/refcounttree.c:3783 [inline]
__ocfs2_reflink+0x4b6/0x16f0 fs/ocfs2/refcounttree.c:4172
ocfs2_reflink+0x4e4/0x920 fs/ocfs2/refcounttree.c:4277
ocfs2_vfs_reflink+0x333/0x450 fs/ocfs2/refcounttree.c:4403
ocfs2_reflink_ioctl+0x39c/0x440 fs/ocfs2/refcounttree.c:4443
ocfs2_ioctl+0x584/0x7c0 fs/ocfs2/ioctl.c:913
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856
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
-> #2 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}:
down_write+0x36/0x60 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:764 [inline]
ocfs2_reserve_suballoc_bits+0x16a/0x4810 fs/ocfs2/suballoc.c:804
ocfs2_reserve_new_metadata_blocks+0x412/0x9a0 fs/ocfs2/suballoc.c:1000
ocfs2_create_refcount_tree+0x299/0x1370 fs/ocfs2/refcounttree.c:571
ocfs2_attach_refcount_tree fs/ocfs2/refcounttree.c:3783 [inline]
__ocfs2_reflink+0x4b6/0x16f0 fs/ocfs2/refcounttree.c:4172
ocfs2_reflink+0x4e4/0x920 fs/ocfs2/refcounttree.c:4277
ocfs2_vfs_reflink+0x333/0x450 fs/ocfs2/refcounttree.c:4403
ocfs2_reflink_ioctl+0x39c/0x440 fs/ocfs2/refcounttree.c:4443
ocfs2_ioctl+0x584/0x7c0 fs/ocfs2/ioctl.c:913
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856
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 (&oi->ip_alloc_sem){+.+.}-{3:3}:
down_write+0x36/0x60 kernel/locking/rwsem.c:1573
ocfs2_reflink+0x4cb/0x920 fs/ocfs2/refcounttree.c:4276
ocfs2_vfs_reflink+0x333/0x450 fs/ocfs2/refcounttree.c:4403
ocfs2_reflink_ioctl+0x39c/0x440 fs/ocfs2/refcounttree.c:4443
ocfs2_ioctl+0x584/0x7c0 fs/ocfs2/ioctl.c:913
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856
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_xattr_sem){++++}-{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+0x2d18/0x7c40 kernel/locking/lockdep.c:5063
lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5676
down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520
ocfs2_init_acl+0x307/0x770 fs/ocfs2/acl.c:365
ocfs2_mknod+0x18e0/0x2580 fs/ocfs2/namei.c:410
ocfs2_create+0x1b6/0x4b0 fs/ocfs2/namei.c:674
lookup_open fs/namei.c:3533 [inline]
open_last_lookups fs/namei.c:3601 [inline]
path_openat+0x11b9/0x2f10 fs/namei.c:3831
do_filp_open+0x1ee/0x420 fs/namei.c:3861
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
other info that might help us debug this:
Chain exists of:
&oi->ip_xattr_sem --> sb_internal#5 --> &journal->j_trans_barrier
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&journal->j_trans_barrier);
lock(sb_internal#5);
lock(&journal->j_trans_barrier);
lock(&oi->ip_xattr_sem);
*** DEADLOCK ***
8 locks held by syz.6.277/6015:
#0: ffff88801e7f6460 (sb_writers#18){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:402
#1: ffff8880555e1808 (&type->i_mutex_dir_key#10){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:764 [inline]
#1: ffff8880555e1808 (&type->i_mutex_dir_key#10){+.+.}-{3:3}, at: open_last_lookups fs/namei.c:3598 [inline]
#1: ffff8880555e1808 (&type->i_mutex_dir_key#10){+.+.}-{3:3}, at: path_openat+0x7e8/0x2f10 fs/namei.c:3831
#2: ffff888073da9808 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:764 [inline]
#2: ffff888073da9808 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x16a/0x4810 fs/ocfs2/suballoc.c:804
#3: ffff888073da89c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:764 [inline]
#3: ffff888073da89c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x16a/0x4810 fs/ocfs2/suballoc.c:804
#4: ffff888073dab488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:764 [inline]
#4: ffff888073dab488 (&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: ffff88801e7f6650 (sb_internal#5){.+.+}-{0:0}, at: ocfs2_mknod+0x1273/0x2580 fs/ocfs2/namei.c:361
#6: ffff88805f0e8ce8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a4/0x6f0 fs/ocfs2/journal.c:374
#7: ffff88805965a990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x2014/0x2240 fs/jbd2/transaction.c:463
stack backtrace:
CPU: 0 PID: 6015 Comm: syz.6.277 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
check_noncircular+0x296/0x330 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+0x2d18/0x7c40 kernel/locking/lockdep.c:5063
lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5676
down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520
ocfs2_init_acl+0x307/0x770 fs/ocfs2/acl.c:365
ocfs2_mknod+0x18e0/0x2580 fs/ocfs2/namei.c:410
ocfs2_create+0x1b6/0x4b0 fs/ocfs2/namei.c:674
lookup_open fs/namei.c:3533 [inline]
open_last_lookups fs/namei.c:3601 [inline]
path_openat+0x11b9/0x2f10 fs/namei.c:3831
do_filp_open+0x1ee/0x420 fs/namei.c:3861
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
RIP: 0033:0x7f3f5a19e159
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:00007f3f5b133028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f3f5a425fa0 RCX: 00007f3f5a19e159
RDX: 0000000000141842 RSI: 0000200000000000 RDI: ffffffffffffff9c
RBP: 00007f3f5a23503b R08: 0000000000000000 R09: 0000000000000000
R10: 00000000000001c2 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f3f5a426038 R14: 00007f3f5a425fa0 R15: 00007fff62e69878
general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
CPU: 1 PID: 6015 Comm: syz.6.277 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:ocfs2_find_dir_space_id fs/ocfs2/dir.c:3425 [inline]
RIP: 0010:ocfs2_prepare_dir_for_insert+0x316c/0x5600 fs/ocfs2/dir.c:4305
Code: ff ff e8 f7 4e 3c fe e9 a5 d1 ff ff e8 ed 4e 3c fe e9 da 02 00 00 e8 e3 4e 3c fe 49 8d 7f 08 49 8d 5f 09 48 89 f8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 4c 8b 74 24 18 0f 85 5c 1f 00 00 4c 2b b4 24
RSP: 0018:ffffc90003ed6240 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000009 RCX: 0000000000080000
RDX: ffffc9000dfe7000 RSI: 0000000000021711 RDI: 0000000000000008
RBP: ffffc90003ed6970 R08: ffffc90003ed6bd0 R09: 0000000000000002
R10: 0000000000000002 R11: 0000000000000002 R12: dffffc0000000000
R13: fffff520007dac6c R14: 1ffff1100aabca01 R15: 0000000000000000
FS: 00007f3f5b1336c0(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f3f5a3f36b8 CR3: 0000000056943000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__ocfs2_prepare_orphan_dir+0x141/0x310 fs/ocfs2/namei.c:2164
ocfs2_prepare_orphan_dir+0xed/0x410 fs/ocfs2/namei.c:2207
ocfs2_add_inode_to_orphan+0x20a/0x7b0 fs/ocfs2/namei.c:2655
ocfs2_dio_wr_get_block+0x7cf/0x1810 fs/ocfs2/aops.c:2213
get_more_blocks fs/direct-io.c:659 [inline]
do_direct_IO fs/direct-io.c:947 [inline]
__blockdev_direct_IO+0x171f/0x34c0 fs/direct-io.c:1260
ocfs2_direct_IO+0x233/0x2a0 fs/ocfs2/aops.c:2488
generic_file_direct_write+0x112/0x330 mm/filemap.c:3787
__generic_file_write_iter+0x15f/0x2a0 mm/filemap.c:3945
ocfs2_file_write_iter+0x1731/0x1fc0 fs/ocfs2/file.c:2469
do_iter_readv_writev fs/read_write.c:-1 [inline]
do_iter_write+0x638/0xb10 fs/read_write.c:861
iter_file_splice_write+0x6be/0xcf0 fs/splice.c:685
do_splice_from fs/splice.c:763 [inline]
direct_splice_actor+0xe1/0x130 fs/splice.c:950
splice_direct_to_actor+0x4b8/0xbd0 fs/splice.c:896
do_splice_direct+0x1ce/0x2f0 fs/splice.c:1002
do_sendfile+0x51b/0xe20 fs/read_write.c:1255
__do_sys_sendfile64 fs/read_write.c:1323 [inline]
__se_sys_sendfile64+0x141/0x1a0 fs/read_write.c:1309
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:0x7f3f5a19e159
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:00007f3f5b133028 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f3f5a425fa0 RCX: 00007f3f5a19e159
RDX: 0000000000000000 RSI: 0000000000000008 RDI: 0000000000000007
RBP: 00007f3f5a23503b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000020fffe82 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f3f5a426038 R14: 00007f3f5a425fa0 R15: 00007fff62e69878
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:ocfs2_find_dir_space_id fs/ocfs2/dir.c:3425 [inline]
RIP: 0010:ocfs2_prepare_dir_for_insert+0x316c/0x5600 fs/ocfs2/dir.c:4305
Code: ff ff e8 f7 4e 3c fe e9 a5 d1 ff ff e8 ed 4e 3c fe e9 da 02 00 00 e8 e3 4e 3c fe 49 8d 7f 08 49 8d 5f 09 48 89 f8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 4c 8b 74 24 18 0f 85 5c 1f 00 00 4c 2b b4 24
RSP: 0018:ffffc90003ed6240 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000009 RCX: 0000000000080000
RDX: ffffc9000dfe7000 RSI: 0000000000021711 RDI: 0000000000000008
RBP: ffffc90003ed6970 R08: ffffc90003ed6bd0 R09: 0000000000000002
R10: 0000000000000002 R11: 0000000000000002 R12: dffffc0000000000
R13: fffff520007dac6c R14: 1ffff1100aabca01 R15: 0000000000000000
FS: 00007f3f5b1336c0(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fce83268c50 CR3: 0000000056943000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
0: ff ljmp (bad)
1: e8 f7 4e 3c fe call 0xfe3c4efd
6: e9 a5 d1 ff ff jmp 0xffffd1b0
b: e8 ed 4e 3c fe call 0xfe3c4efd
10: e9 da 02 00 00 jmp 0x2ef
15: e8 e3 4e 3c fe call 0xfe3c4efd
1a: 49 8d 7f 08 lea 0x8(%r15),%rdi
1e: 49 8d 5f 09 lea 0x9(%r15),%rbx
22: 48 89 f8 mov %rdi,%rax
25: 48 c1 e8 03 shr $0x3,%rax
* 29: 42 0f b6 04 20 movzbl (%rax,%r12,1),%eax <-- trapping instruction
2e: 84 c0 test %al,%al
30: 4c 8b 74 24 18 mov 0x18(%rsp),%r14
35: 0f 85 5c 1f 00 00 jne 0x1f97
3b: 4c rex.WR
3c: 2b .byte 0x2b
3d: b4 24 mov $0x24,%ah