All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Dave Chinner <david@fromorbit.com>, xfs@oss.sgi.com
Subject: Re: [PATCH] repair: ensure that unused superblock fields are zeroed
Date: Tue, 11 Mar 2014 08:29:51 -0500	[thread overview]
Message-ID: <531F0FCF.2000807@sandeen.net> (raw)
In-Reply-To: <1394518948-1506-1-git-send-email-david@fromorbit.com>

On 3/11/14, 1:22 AM, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> When we grab a superblock off disk via get_sb(), we don't know what
> the in-memory superblock we are filling out contained. We ned to
> ensure that the entire structure is returned in an initialised
> state regardless of which fields libxfs_sb_from_disk() populates
> from disk. In this case, it doesn't populate the sb_crc field,
> and so uninitialised values can escape through to disk on v4
> filesystems because of this. This causes xfs/031 to fail on v4
> filesystems.
> 
> Reported-by: Eric Sandeen <sandeen@redhat.com>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>

cool, thanks for finding that "overnight."  :)

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  repair/sb.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/repair/sb.c b/repair/sb.c
> index b111aca..d928dc0 100644
> --- a/repair/sb.c
> +++ b/repair/sb.c
> @@ -518,6 +518,7 @@ get_sb(xfs_sb_t *sbp, xfs_off_t off, int size, xfs_agnumber_t agno)
>  		exit(1);
>  	}
>  	memset(buf, 0, size);
> +	memset(sbp, 0, sizeof(*sbp));
>  
>  	/* try and read it first */
>  
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      reply	other threads:[~2014-03-11 13:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-11  6:22 [PATCH] repair: ensure that unused superblock fields are zeroed Dave Chinner
2014-03-11 13:29 ` Eric Sandeen [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=531F0FCF.2000807@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=david@fromorbit.com \
    --cc=xfs@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.