Re: [Fwd: [Bug] 2.6.30 kernel stack trace with 'fsfuzzer ext3' on s390]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed 22-07-09 10:42:52, Nageswara R Sastry wrote:
> Hi Jan,
>
> >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...
>
> 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.

								Honza
-- 
Jan Kara <jack@xxxxxxx>
SUSE Labs, CR
>From 7447a668a3860b66b3c9db86fdea91e355ba59ac Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@xxxxxxx>
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.

Reported-by: Nageswara R Sastry <rnsastry@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Jan Kara <jack@xxxxxxx>
---
 fs/jbd/journal.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index 737f724..94a64a1 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -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;
-- 
1.6.0.2


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux