xfs
[Top] [All Lists]

Re: [PATCH] repair: ensure that unused superblock fields are zeroed

To: Dave Chinner <david@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
Subject: Re: [PATCH] repair: ensure that unused superblock fields are zeroed
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Tue, 11 Mar 2014 08:29:51 -0500
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1394518948-1506-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1394518948-1506-1-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
On 3/11/14, 1:22 AM, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>

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

Reviewed-by: Eric Sandeen <sandeen@xxxxxxxxxx>

> ---
>  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 */
>  
> 

<Prev in Thread] Current Thread [Next in Thread>