Skip to contentSkip to conversation

2.6.30 kernel stack trace with 'fsfuzzer ext3' on

Fwd: Kamalesh Babulal 1 participant 1 message Jul 23, 2009 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Kamalesh Babulal

author Tested-by
#1 lore raw
Quoted 11 lines · Jan Kara
Quoted 10 lines · Nageswara R Sastry

Hi Jan,

Quoted 7 lines

My first guess would be that journal superblock was corrupted by fsfuzzer so that the journal had less than 32 blocks and the warning triggered. That being said, we might use more sanity checks when loading journal superblock because currently it just blindly consumes what's on disk. We can't do too much since we don't know anything about the filesystem structure but we can do at least something. I'll write a patch for that in a moment...

Quoted 5 lines
Quoted 1 line

Any updates on this. Thanks!!

I have a patch queued for this in my patch queue and will ask Linus for
merging it probably tomorrow. Similar JBD2 fix is in the Ted's patch queue also waiting for being merged. I'm also attaching the fix for your convenience.

Thanks, the patch fixes the warning.

Quoted 14 lines

Honza

Signature · 10 lines
Jan Kara <[email protected]>
SUSE Labs, CR

From 7447a668a3860b66b3c9db86fdea91e355ba59ac Mon Sep 17 00:00:00 2001
From: Jan Kara <[email protected]>
Date: Wed, 15 Jul 2009 20:36:08 +0200
Subject: [PATCH 1/5] jbd: Fail to load a journal if it is too short

Due to on disk corruption, it can happen that journal is too short. Fail
to load it in such case so that we don't oops somewhere later.
Quoted 26 lines
---
 fs/jbd/journal.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
fs/jbd/journal.c +6 -0
index 737f724..94a64a1 100644
@@ -848,6 +848,12 @@ static int journal_reset(journal_t *journal)
 
 	first = be32_to_cpu(sb->s_first);
 	last = be32_to_cpu(sb->s_maxlen);
+	if (first + JFS_MIN_JOURNAL_BLOCKS > last + 1) {
+		printk(KERN_ERR "JBD: Journal too short (blocks %lu-%lu).\n",
+		       first, last);
+		journal_fail_superblock(journal);
+		return -EINVAL;
+	}
 
 	journal->j_first = first;
 	journal->j_last = last;
Signature · 1 line
1.6.0.2

Kamalesh