======================================================
WARNING: possible circular locking dependency detected
6.1.147-syzkaller #0 Not tainted
------------------------------------------------------
syz.1.69/4889 is trying to acquire lock:
ffff88805bb81488 (&osb->system_file_mutex){+.+.}-{3:3}, at: ocfs2_get_system_file_inode+0x1a2/0x7b0 fs/ocfs2/sysfile.c:101
but task is already holding lock:
ffff888068ceb120 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_write_begin+0x195/0x300 fs/ocfs2/aops.c:1902
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}:
down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520
ocfs2_read_virt_blocks+0x265/0x950 fs/ocfs2/extent_map.c:976
ocfs2_read_dir_block fs/ocfs2/dir.c:508 [inline]
ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline]
ocfs2_find_entry+0x3d1/0x20c0 fs/ocfs2/dir.c:1091
ocfs2_find_files_on_disk+0x102/0x390 fs/ocfs2/dir.c:1995
ocfs2_lookup_ino_from_name+0x4f/0xf0 fs/ocfs2/dir.c:2017
_ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline]
ocfs2_get_system_file_inode+0x332/0x7b0 fs/ocfs2/sysfile.c:112
ocfs2_init_global_system_inodes+0x316/0x650 fs/ocfs2/super.c:457
ocfs2_initialize_super fs/ocfs2/super.c:2253 [inline]
ocfs2_fill_super+0x2a32/0x4d00 fs/ocfs2/super.c:994
mount_bdev+0x287/0x3c0 fs/super.c:1443
legacy_get_tree+0xe6/0x180 fs/fs_context.c:632
vfs_get_tree+0x88/0x270 fs/super.c:1573
do_new_mount+0x24a/0xa40 fs/namespace.c:3063
do_mount fs/namespace.c:3406 [inline]
__do_sys_mount fs/namespace.c:3614 [inline]
__se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3591
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
-> #0 (&osb->system_file_mutex){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain kernel/locking/lockdep.c:3825 [inline]
__lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049
lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x120/0xaf0 kernel/locking/mutex.c:747
ocfs2_get_system_file_inode+0x1a2/0x7b0 fs/ocfs2/sysfile.c:101
ocfs2_reserve_suballoc_bits+0x135/0x4630 fs/ocfs2/suballoc.c:776
ocfs2_reserve_cluster_bitmap_bits fs/ocfs2/suballoc.c:1128 [inline]
ocfs2_reserve_clusters_with_limit+0x2f8/0xba0 fs/ocfs2/suballoc.c:1173
ocfs2_convert_inline_data_to_extents+0x1c6/0x11f0 fs/ocfs2/alloc.c:7079
ocfs2_try_to_write_inline_data fs/ocfs2/aops.c:1563 [inline]
ocfs2_write_begin_nolock+0x178f/0x4270 fs/ocfs2/aops.c:1670
ocfs2_write_begin+0x1b8/0x300 fs/ocfs2/aops.c:1904
generic_perform_write+0x2db/0x560 mm/filemap.c:3846
__generic_file_write_iter+0x172/0x430 mm/filemap.c:3974
ocfs2_file_write_iter+0x1593/0x1df0 fs/ocfs2/file.c:2469
__kernel_write_iter+0x26d/0x630 fs/read_write.c:517
__kernel_write+0xec/0x140 fs/read_write.c:537
__dump_emit+0x202/0x310 fs/coredump.c:873
elf_core_dump+0x2996/0x3490 fs/binfmt_elf.c:2333
do_coredump+0x15ff/0x22b0 fs/coredump.c:824
get_signal+0x10aa/0x1350 kernel/signal.c:2857
arch_do_signal_or_restart+0xb0/0x1230 arch/x86/kernel/signal.c:871
exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210
irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:316
exc_page_fault+0x88/0x100 arch/x86/mm/fault.c:1490
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&ocfs2_file_ip_alloc_sem_key);
lock(&osb->system_file_mutex);
lock(&ocfs2_file_ip_alloc_sem_key);
lock(&osb->system_file_mutex);
*** DEADLOCK ***
3 locks held by syz.1.69/4889:
#0: ffff88805888c460 (sb_writers#13){.+.+}-{0:0}, at: do_coredump+0x15de/0x22b0 fs/coredump.c:823
#1: ffff888068ceb488 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
#1: ffff888068ceb488 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: ocfs2_file_write_iter+0x438/0x1df0 fs/ocfs2/file.c:2399
#2: ffff888068ceb120 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_write_begin+0x195/0x300 fs/ocfs2/aops.c:1902
stack backtrace:
CPU: 1 PID: 4889 Comm: syz.1.69 Not tainted 6.1.147-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2170
check_prev_add kernel/locking/lockdep.c:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain kernel/locking/lockdep.c:3825 [inline]
__lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049
lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x120/0xaf0 kernel/locking/mutex.c:747
ocfs2_get_system_file_inode+0x1a2/0x7b0 fs/ocfs2/sysfile.c:101
ocfs2_reserve_suballoc_bits+0x135/0x4630 fs/ocfs2/suballoc.c:776
ocfs2_reserve_cluster_bitmap_bits fs/ocfs2/suballoc.c:1128 [inline]
ocfs2_reserve_clusters_with_limit+0x2f8/0xba0 fs/ocfs2/suballoc.c:1173
ocfs2_convert_inline_data_to_extents+0x1c6/0x11f0 fs/ocfs2/alloc.c:7079
ocfs2_try_to_write_inline_data fs/ocfs2/aops.c:1563 [inline]
ocfs2_write_begin_nolock+0x178f/0x4270 fs/ocfs2/aops.c:1670
ocfs2_write_begin+0x1b8/0x300 fs/ocfs2/aops.c:1904
generic_perform_write+0x2db/0x560 mm/filemap.c:3846
__generic_file_write_iter+0x172/0x430 mm/filemap.c:3974
ocfs2_file_write_iter+0x1593/0x1df0 fs/ocfs2/file.c:2469
__kernel_write_iter+0x26d/0x630 fs/read_write.c:517
__kernel_write+0xec/0x140 fs/read_write.c:537
__dump_emit+0x202/0x310 fs/coredump.c:873
elf_core_dump+0x2996/0x3490 fs/binfmt_elf.c:2333
do_coredump+0x15ff/0x22b0 fs/coredump.c:824
get_signal+0x10aa/0x1350 kernel/signal.c:2857
arch_do_signal_or_restart+0xb0/0x1230 arch/x86/kernel/signal.c:871
exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210
irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:316
exc_page_fault+0x88/0x100 arch/x86/mm/fault.c:1490
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608
RIP: 0033:0x7fae7b84f927
Code: 88 15 d2 5d e9 00 88 05 cf 5d e9 00 c3 50 48 8d 35 01 25 1c 00 48 8d 3d 07 25 1c 00 31 c0 e8 20 f7 ff ff 53 89 fb 48 83 ec 10 <64> 8b 04 25 94 ff ff ff 85 c0 74 2a 89 fe 31 c0 bf 3c 00 00 00 e8
RSP: 002b:00007fae7c78d120 EFLAGS: 00010202
RAX: 0000000000000000 RBX: 000000000000000b RCX: 00007fae7b98ebe9
RDX: 00007fae7c78d140 RSI: 00007fae7c78d270 RDI: 000000000000000b
RBP: 00007fae7ba11e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
R13: 00007fae7bbb6038 R14: 00007fae7bbb5fa0 R15: 00007ffdfe9ff158
------------[ cut here ]------------
kernel BUG at fs/ocfs2/alloc.c:5574!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 4889 Comm: syz.1.69 Not tainted 6.1.147-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
RIP: 0010:ocfs2_remove_extent+0x1e70/0x2010 fs/ocfs2/alloc.c:5574
Code: fe e9 70 fa ff ff 48 8b 0c 24 80 e1 07 fe c1 38 c1 0f 8c b0 fa ff ff 48 8b 3c 24 e8 0a 56 9c fe e9 a2 fa ff ff e8 a0 39 4c fe <0f> 0b 65 44 8b 3d 56 8c cd 7c 48 c7 c0 b0 4d 1f 8e 48 c1 e8 03 42
RSP: 0018:ffffc900040b6560 EFLAGS: 00010293
RAX: ffffffff83348d40 RBX: ffff888050e824d0 RCX: ffff88802ea23b80
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000003
RBP: ffffc900040b6890 R08: ffff88802ea23b80 R09: 0000000000000006
R10: 00000000fffffffc R11: 0000000000000000 R12: 0000000000000003
R13: 1ffff1100a1d049a R14: dffffc0000000000 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f12438b10a0 CR3: 0000000079809000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
ocfs2_remove_btree_range+0xd92/0x1480 fs/ocfs2/alloc.c:5771
ocfs2_commit_truncate+0xaf5/0x1bf0 fs/ocfs2/alloc.c:7354
ocfs2_truncate_for_delete fs/ocfs2/inode.c:623 [inline]
ocfs2_wipe_inode fs/ocfs2/inode.c:790 [inline]
ocfs2_delete_inode fs/ocfs2/inode.c:1079 [inline]
ocfs2_evict_inode+0x10d5/0x41e0 fs/ocfs2/inode.c:1216
evict+0x485/0x870 fs/inode.c:705
ocfs2_dentry_iput+0x244/0x370 fs/ocfs2/dcache.c:418
__dentry_kill+0x431/0x650 fs/dcache.c:611
dentry_kill+0xb8/0x290 fs/dcache.c:-1
dput+0xfa/0x1d0 fs/dcache.c:918
__fput+0x5e0/0x920 fs/file_table.c:328
task_work_run+0x1ca/0x250 kernel/task_work.c:203
exit_task_work include/linux/task_work.h:39 [inline]
do_exit+0x93e/0x2400 kernel/exit.c:880
do_group_exit+0x217/0x2d0 kernel/exit.c:1022
get_signal+0x1272/0x1350 kernel/signal.c:2871
arch_do_signal_or_restart+0xb0/0x1230 arch/x86/kernel/signal.c:871
exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210
irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:316
exc_page_fault+0x88/0x100 arch/x86/mm/fault.c:1490
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608
RIP: 0033:0x7fae7b84f927
Code: Unable to access opcode bytes at 0x7fae7b84f8fd.
RSP: 002b:00007fae7c78d120 EFLAGS: 00010202
RAX: 0000000000000000 RBX: 000000000000000b RCX: 00007fae7b98ebe9
RDX: 00007fae7c78d140 RSI: 00007fae7c78d270 RDI: 000000000000000b
RBP: 00007fae7ba11e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
R13: 00007fae7bbb6038 R14: 00007fae7bbb5fa0 R15: 00007ffdfe9ff158
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:ocfs2_remove_extent+0x1e70/0x2010 fs/ocfs2/alloc.c:5574
Code: fe e9 70 fa ff ff 48 8b 0c 24 80 e1 07 fe c1 38 c1 0f 8c b0 fa ff ff 48 8b 3c 24 e8 0a 56 9c fe e9 a2 fa ff ff e8 a0 39 4c fe <0f> 0b 65 44 8b 3d 56 8c cd 7c 48 c7 c0 b0 4d 1f 8e 48 c1 e8 03 42
RSP: 0018:ffffc900040b6560 EFLAGS: 00010293
RAX: ffffffff83348d40 RBX: ffff888050e824d0 RCX: ffff88802ea23b80
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000003
RBP: ffffc900040b6890 R08: ffff88802ea23b80 R09: 0000000000000006
R10: 00000000fffffffc R11: 0000000000000000 R12: 0000000000000003
R13: 1ffff1100a1d049a R14: dffffc0000000000 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005555858d75c8 CR3: 0000000024391000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400