linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Eryu Guan <eguan@redhat.com>
Cc: fstests@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: mount with corrupted inopblock in superblock
Date: Fri, 4 Nov 2016 11:54:34 +1100	[thread overview]
Message-ID: <20161104005433.GF28177@dastard> (raw)
In-Reply-To: <1478166720-14354-1-git-send-email-eguan@redhat.com>

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?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2016-11-04  0:54 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 [this message]
2016-11-04  3:14   ` Darrick J. Wong

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=20161104005433.GF28177@dastard \
    --to=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).