linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Eryu Guan <eguan@redhat.com>,
	fstests@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: mount with corrupted inopblock in superblock
Date: Thu, 3 Nov 2016 20:14:45 -0700	[thread overview]
Message-ID: <20161104031445.GD32036@birch.djwong.org> (raw)
In-Reply-To: <20161104005433.GF28177@dastard>

On Fri, Nov 04, 2016 at 11:54:34AM +1100, Dave Chinner wrote:
> On Thu, Nov 03, 2016 at 05:52:00PM +0800, Eryu Guan wrote:
> > When sb_inopblock is corrupted (out of boundary in this case), XFS
> > should not crash and refuse to mount.
> > 
> > Kernel commit 392c6de98af1 ("xfs: sanitize sb_inopblock in
> > xfs_mount_validate_sb") addresses this issue.
> 
> Ok, seems like something addressed by the fuzzing tests, but we can
> ignore that for now.
> 
> > +_scratch_mkfs >>$seqres.full
> > +
> > +# corrupt sb_inopblock
> > +_scratch_xfs_db -x -c "sb 0" -c "write -c inopblock 512" >>$seqres.full
> > +
> > +# mount corrupted fs
> > +_scratch_mount >>$seqres.full 2>&1
> > +
> > +# no crash, and SCRATCH_DEV should not be mounted either
> > +_is_mounted $SCRATCH_DEV
> 
> Rather than test that we caught /one/ corrupt field, why not
> loop here corrupting each superblock field in turn and checking
> that the corruption is caught properly?
> 
> i.e. shouldn't we be proactively testing that we're catching all the
> obvious corruptions, rather than just testing the out-of-bounds
> issues that we've already found and fixed?

I've been working on xfstests that do exactly that for a while now and
am getting ready to do a big patch dump of online scrub/repair + more
dangerous_fuzzers tests to see how well the recovery tools work.

In the meantime I doubt it hurts to have this regression test while I
get my act together. :)

--D

> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2016-11-04  3:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-03  9:52 [PATCH] xfs: mount with corrupted inopblock in superblock Eryu Guan
2016-11-04  0:54 ` Dave Chinner
2016-11-04  3:14   ` Darrick J. Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161104031445.GD32036@birch.djwong.org \
    --to=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).