Dear Linux maintainers and reviewers:
We are reporting a Linux kernel bug titled **kernel BUG in __ocfs2_flush_truncate_log**, discovered using a modified version of Syzkaller.
Linux version : 89748acdf226fd1a8775ff6fa2703f8412b286c8
The test case, kernel config are attached.
The report is (The full report is attached):
------------[ cut here ]------------
kernel BUG at fs/ocfs2/alloc.c:6019!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 32348 Comm: syz-executor Not tainted 6.16.0-g89748acdf226-dirty #2 PREEMPT(full)
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014
RIP: 0010:__ocfs2_flush_truncate_log+0x10be/0x1210 fs/ocfs2/alloc.c:6019
Code: 44 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c 70 fb ff ff 4c 89 ff e8 33 08 73 fe e9 63 fb ff ff e8 29 aa 06 fe 0f 0b e8 22 aa 06 fe <0f> 0b f3 0f 1e fa 65 44 8b 25 08 08 73 0f bf 07 00 00 00 44 89 e6
RSP: 0018:ffffc900025379a0 EFLAGS: 00010293
RAX: ffffffff83ba181e RBX: ffff88806582aa00 RCX: ffff88801e0c8000
RDX: 0000000000000000 RSI: 00000000ffffffff RDI: 0000000000000000
RBP: ffffc90002537bb8 R08: ffffc90002537927 R09: 1ffff920004a6f24
R10: dffffc0000000000 R11: fffff520004a6f25 R12: 00000000ffffffff
R13: ffff888069e4b338 R14: ffffc90002537ac0 R15: ffff888012be8400
FS: 00005555901dfa00(0000) GS:ffff888098f4e000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000560653f3c048 CR3: 000000001bd2b000 CR4: 0000000000752ef0
PKRU: 80000000
Call Trace:
<TASK>
ocfs2_flush_truncate_log+0x4f/0x70 fs/ocfs2/alloc.c:6084
ocfs2_sync_fs+0x13e/0x3a0 fs/ocfs2/super.c:406
sync_filesystem+0x1cf/0x230 fs/sync.c:66
generic_shutdown_super+0x6f/0x2c0 fs/super.c:622
kill_block_super+0x44/0x90 fs/super.c:1766
deactivate_locked_super+0xc4/0x120 fs/super.c:474
cleanup_mnt+0x42e/0x4d0 fs/namespace.c:1378
task_work_run+0x258/0x320 kernel/task_work.c:227
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
exit_to_user_mode_loop+0xec/0x110 kernel/entry/common.c:43
exit_to_user_mode_prepare include/linux/irq-entry-common.h:224 [inline]
syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]
do_syscall_64+0x250/0x3b0 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7f4a7dbb1e7b
Code: ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 90 f3 0f 1e fa 31 f6 e9 05 00 00 00 0f 1f 44 00 00 f3 0f 1e fa b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffdecf11988 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 000000000000007a RCX: 00007f4a7dbb1e7b
RDX: 00007f4a7da50e80 RSI: 0000000000000009 RDI: 00007ffdecf11a40
RBP: 00007ffdecf11a40 R08: 00007f4a7dc34caa R09: 00007ffdecf11810
R10: 00000000fffffffb R11: 0000000000000246 R12: 00007f4a7dc34c86
R13: 00007ffdecf12b10 R14: 00005555901f2b60 R15: 0000000000063704
</TASK>