Re: [syzbot] [ext4?] [ocfs2?] KASAN: null-ptr-deref Write in jbd2_journal_update_sb_log_tail

syzbot
2024-08-19T12:06:02Z

Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
kernel BUG in ocfs2_cluster_unlock

(syz.0.15,5591,0):ocfs2_check_volume:2428 ERROR: ocfs2 journal load failed! -22
(syz.0.15,5591,0):ocfs2_check_volume:2484 ERROR: status = -22
(syz.0.15,5591,0):ocfs2_mount_volume:1821 ERROR: status = -22
------------[ cut here ]------------
kernel BUG at fs/ocfs2/dlmglue.c:862!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 5591 Comm: syz.0.15 Not tainted 6.11.0-rc3-syzkaller-00338-gc3f2d783a459-dirty #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:ocfs2_dec_holders fs/ocfs2/dlmglue.c:862 [inline]
RIP: 0010:__ocfs2_cluster_unlock fs/ocfs2/dlmglue.c:1690 [inline]
RIP: 0010:ocfs2_cluster_unlock+0x3ea/0x400 fs/ocfs2/dlmglue.c:346
Code: 89 ef e8 09 09 79 fe e9 32 fe ff ff e8 5f c7 11 fe 90 0f 0b e8 57 c7 11 fe 90 0f 0b e8 4f c7 11 fe 90 0f 0b e8 47 c7 11 fe 90 <0f> 0b e8 3f c7 11 fe 90 0f 0b 66 2e 0f 1f 84 00 00 00 00 00 66 90
RSP: 0018:ffffc900022a6f50 EFLAGS: 00010093
RAX: ffffffff8381c3a9 RBX: 0000000000000246 RCX: ffff88801c05c880
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 1ffff110078e904d R08: ffffffff8381c0a0 R09: ffffffff8381c019
R10: 0000000000000002 R11: ffff88801c05c880 R12: ffff88803c74826c
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff88803c748200
FS: 00007f63d75ff6c0(0000) GS:ffff888020800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000559404ff8000 CR3: 0000000020252000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
ocfs2_journal_shutdown+0x53e/0xbe0 fs/ocfs2/journal.c:1102
ocfs2_mount_volume+0x17cd/0x1ac0 fs/ocfs2/super.c:1845
ocfs2_fill_super+0x483b/0x5880 fs/ocfs2/super.c:1084
mount_bdev+0x20a/0x2d0 fs/super.c:1679
legacy_get_tree+0xee/0x190 fs/fs_context.c:662
vfs_get_tree+0x90/0x2a0 fs/super.c:1800
do_new_mount+0x2be/0xb40 fs/namespace.c:3472
do_mount fs/namespace.c:3812 [inline]
__do_sys_mount fs/namespace.c:4020 [inline]
__se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3997
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f63d7b7b0ba
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 7e 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f63d75fee68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f63d75feef0 RCX: 00007f63d7b7b0ba
RDX: 0000000020004480 RSI: 00000000200044c0 RDI: 00007f63d75feeb0
RBP: 0000000020004480 R08: 00007f63d75feef0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000200044c0
R13: 00007f63d75feeb0 R14: 0000000000004476 R15: 0000000020001200
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:ocfs2_dec_holders fs/ocfs2/dlmglue.c:862 [inline]
RIP: 0010:__ocfs2_cluster_unlock fs/ocfs2/dlmglue.c:1690 [inline]
RIP: 0010:ocfs2_cluster_unlock+0x3ea/0x400 fs/ocfs2/dlmglue.c:346
Code: 89 ef e8 09 09 79 fe e9 32 fe ff ff e8 5f c7 11 fe 90 0f 0b e8 57 c7 11 fe 90 0f 0b e8 4f c7 11 fe 90 0f 0b e8 47 c7 11 fe 90 <0f> 0b e8 3f c7 11 fe 90 0f 0b 66 2e 0f 1f 84 00 00 00 00 00 66 90
RSP: 0018:ffffc900022a6f50 EFLAGS: 00010093
RAX: ffffffff8381c3a9 RBX: 0000000000000246 RCX: ffff88801c05c880
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 1ffff110078e904d R08: ffffffff8381c0a0 R09: ffffffff8381c019
R10: 0000000000000002 R11: ffff88801c05c880 R12: ffff88803c74826c
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff88803c748200
FS: 00007f63d75ff6c0(0000) GS:ffff888020800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000559404ff8000 CR3: 0000000020252000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Tested on:

commit: c3f2d783 Merge tag 'mm-hotfixes-stable-2024-08-17-19-3..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=11e793cb980000
kernel config: https://syzkaller.appspot.com/x/.config?x=7229118d88b4a71b
dashboard link: https://syzkaller.appspot.com/bug?extid=05b9b39d8bdfe1a0861f
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=11c1eafd980000