public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [ocfs2?] kernel BUG in ocfs2_populate_inode
@ 2024-09-24  5:20 syzbot
  2025-12-16 18:52 ` Syzbot test for ocfs2: handle OCFS2_SUPER_BLOCK_FL flag in system dinode Prithvi Tambewagh
  0 siblings, 1 reply; 3+ messages in thread
From: syzbot @ 2024-09-24  5:20 UTC (permalink / raw)
  To: jlbec, joseph.qi, linux-kernel, mark, ocfs2-devel, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    2004cef11ea0 Merge tag 'sched-core-2024-09-19' of git://gi..
git tree:       upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=17e84ca9980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=38d475ce6711b8b4
dashboard link: https://syzkaller.appspot.com/bug?extid=779d072a1067a8b1a917
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11257b00580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=10bfc427980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/8e353f58adf6/disk-2004cef1.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/0638768bdedf/vmlinux-2004cef1.xz
kernel image: https://storage.googleapis.com/syzbot-assets/89ae9bc7ea4e/bzImage-2004cef1.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/28a85cffdc50/mount_0.gz

Bisection is inconclusive: the issue happens on the oldest tested release.

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=12446e9f980000
final oops:     https://syzkaller.appspot.com/x/report.txt?x=11446e9f980000
console output: https://syzkaller.appspot.com/x/log.txt?x=16446e9f980000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+779d072a1067a8b1a917@syzkaller.appspotmail.com

loop0: detected capacity change from 0 to 32768
------------[ cut here ]------------
kernel BUG at fs/ocfs2/inode.c:336!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 0 UID: 0 PID: 5225 Comm: syz-executor259 Not tainted 6.11.0-syzkaller-07337-g2004cef11ea0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
RIP: 0010:ocfs2_populate_inode+0x17c1/0x17e0 fs/ocfs2/inode.c:336
Code: de e8 a3 93 0e fe 45 84 f6 75 2f e8 99 90 0e fe 49 bc 00 00 00 00 00 fc ff df 4c 8b 6c 24 20 e9 a8 f1 ff ff e8 80 90 0e fe 90 <0f> 0b e8 78 90 0e fe 90 0f 0b 90 e9 bb fe ff ff e8 6a 90 0e fe e8
RSP: 0018:ffffc90003bded20 EFLAGS: 00010293
RAX: ffffffff83862e50 RBX: 0000000000000020 RCX: ffff88804d20da00
RDX: 0000000000000000 RSI: 0000000000000020 RDI: 0000000000000000
RBP: ffffc90003bdee50 R08: ffffffff8386215b R09: 1ffffffff20365d5
R10: dffffc0000000000 R11: fffffbfff20365d6 R12: dffffc0000000000
R13: ffff88807497cfb8 R14: 0000000000000001 R15: ffff88801a86fe2c
FS:  0000555560764380(0000) GS:ffff8880b8800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffd72273000 CR3: 000000007892e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 ocfs2_read_locked_inode fs/ocfs2/inode.c:542 [inline]
 ocfs2_iget+0x1162/0x2180 fs/ocfs2/inode.c:159
 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:142 [inline]
 ocfs2_get_system_file_inode+0x352/0x7b0 fs/ocfs2/sysfile.c:112
 ocfs2_init_global_system_inodes+0x32c/0x730 fs/ocfs2/super.c:457
 ocfs2_initialize_super fs/ocfs2/super.c:2250 [inline]
 ocfs2_fill_super+0x3068/0x5880 fs/ocfs2/super.c:994
 mount_bdev+0x20a/0x2d0 fs/super.c:1679
 legacy_get_tree+0xee/0x190 fs/fs_context.c:662
 vfs_get_tree+0x90/0x2b0 fs/super.c:1800
 do_new_mount+0x2be/0xb40 fs/namespace.c:3507
 do_mount fs/namespace.c:3847 [inline]
 __do_sys_mount fs/namespace.c:4055 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:4032
 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:0x7fc4abec51aa
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 5e 04 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd72272638 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffd72272640 RCX: 00007fc4abec51aa
RDX: 0000000020004480 RSI: 00000000200044c0 RDI: 00007ffd72272640
RBP: 0000000000000004 R08: 00007ffd72272680 R09: 0000000000004476
R10: 0000000000800401 R11: 0000000000000282 R12: 00007ffd72272680
R13: 0000000000000003 R14: 0000000001000000 R15: 00007fc4abf0d03b
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:ocfs2_populate_inode+0x17c1/0x17e0 fs/ocfs2/inode.c:336
Code: de e8 a3 93 0e fe 45 84 f6 75 2f e8 99 90 0e fe 49 bc 00 00 00 00 00 fc ff df 4c 8b 6c 24 20 e9 a8 f1 ff ff e8 80 90 0e fe 90 <0f> 0b e8 78 90 0e fe 90 0f 0b 90 e9 bb fe ff ff e8 6a 90 0e fe e8
RSP: 0018:ffffc90003bded20 EFLAGS: 00010293
RAX: ffffffff83862e50 RBX: 0000000000000020 RCX: ffff88804d20da00
RDX: 0000000000000000 RSI: 0000000000000020 RDI: 0000000000000000
RBP: ffffc90003bdee50 R08: ffffffff8386215b R09: 1ffffffff20365d5
R10: dffffc0000000000 R11: fffffbfff20365d6 R12: dffffc0000000000
R13: ffff88807497cfb8 R14: 0000000000000001 R15: ffff88801a86fe2c
FS:  0000555560764380(0000) GS:ffff8880b8800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffd72273000 CR3: 000000007892e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
For information about bisection process see: https://goo.gl/tpsmEJ#bisection

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Syzbot test for ocfs2: handle OCFS2_SUPER_BLOCK_FL flag in system dinode
  2024-09-24  5:20 [syzbot] [ocfs2?] kernel BUG in ocfs2_populate_inode syzbot
@ 2025-12-16 18:52 ` Prithvi Tambewagh
  2025-12-16 19:41   ` [syzbot] [ocfs2?] kernel BUG in ocfs2_populate_inode syzbot
  0 siblings, 1 reply; 3+ messages in thread
From: Prithvi Tambewagh @ 2025-12-16 18:52 UTC (permalink / raw)
  To: syzbot+779d072a1067a8b1a917, jlbec, joseph.qi, mark
  Cc: linux-kernel, ocfs2-devel, syzkaller-bugs, Prithvi Tambewagh

#syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git d76bb1ebb5587f66b0f8b8099bfbb44722bc08b3

Signed-off-by: Prithvi Tambewagh <activprithvi@gmail.com>
---
 fs/ocfs2/inode.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index 12e5d1f73325..f439dc801845 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -347,7 +347,12 @@ void ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe,
 	} else if (fe->i_flags & cpu_to_le32(OCFS2_SUPER_BLOCK_FL)) {
 		/* we can't actually hit this as read_inode can't
 		 * handle superblocks today ;-) */
-		BUG();
+		ocfs2_error(sb,
+			    "System Inode %llu has "
+			    "OCFS2_SUPER_BLOCK_FL set",
+			    (unsigned long long)le64_to_cpu(fe->i_blkno));
+		make_bad_inode(inode);
+		return;
 	}
 
 	switch (inode->i_mode & S_IFMT) {
@@ -555,6 +560,11 @@ static int ocfs2_read_locked_inode(struct inode *inode,
 
 	ocfs2_populate_inode(inode, fe, 0);
 
+	if (is_bad_inode(inode)) {
+		status = -EIO;
+		goto bail;
+	}
+
 	BUG_ON(args->fi_blkno != le64_to_cpu(fe->i_blkno));
 
 	if (buffer_dirty(bh) && !buffer_jbd(bh)) {
@@ -576,7 +586,7 @@ static int ocfs2_read_locked_inode(struct inode *inode,
 	if (can_lock)
 		ocfs2_inode_unlock(inode, lock_level);
 
-	if (status < 0)
+	if (status < 0 && !is_bad_inode(inode))
 		make_bad_inode(inode);
 
 	brelse(bh);

base-commit: d76bb1ebb5587f66b0f8b8099bfbb44722bc08b3
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [syzbot] [ocfs2?] kernel BUG in ocfs2_populate_inode
  2025-12-16 18:52 ` Syzbot test for ocfs2: handle OCFS2_SUPER_BLOCK_FL flag in system dinode Prithvi Tambewagh
@ 2025-12-16 19:41   ` syzbot
  0 siblings, 0 replies; 3+ messages in thread
From: syzbot @ 2025-12-16 19:41 UTC (permalink / raw)
  To: activprithvi, jlbec, joseph.qi, linux-kernel, mark, ocfs2-devel,
	syzkaller-bugs

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+779d072a1067a8b1a917@syzkaller.appspotmail.com
Tested-by: syzbot+779d072a1067a8b1a917@syzkaller.appspotmail.com

Tested on:

commit:         d76bb1eb Merge tag 'erofs-for-6.15-rc6-fixes' of git:/..
git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=1479e77c580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=b20d1657eb8978a6
dashboard link: https://syzkaller.appspot.com/bug?extid=779d072a1067a8b1a917
compiler:       Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
patch:          https://syzkaller.appspot.com/x/patch.diff?x=13c41d92580000

Note: testing is done by a robot and is best-effort only.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-16 19:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-24  5:20 [syzbot] [ocfs2?] kernel BUG in ocfs2_populate_inode syzbot
2025-12-16 18:52 ` Syzbot test for ocfs2: handle OCFS2_SUPER_BLOCK_FL flag in system dinode Prithvi Tambewagh
2025-12-16 19:41   ` [syzbot] [ocfs2?] kernel BUG in ocfs2_populate_inode syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox