[PATCH v2] libxfs: don't write uninitialized heap contents into new directory blocks

Brian Foster bfoster at redhat.com
Fri Mar 20 06:52:32 CDT 2015


On Thu, Mar 19, 2015 at 04:55:20PM -0700, Darrick J. Wong wrote:
> Clear the contents of the xfs buffer when we're initializing it to avoid
> writing random heap contents (and CRC thereof) to disk.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong at oracle.com>
> ---

Looks good to me:

Reviewed-by: Brian Foster <bfoster at redhat.com>

>  libxfs/rdwr.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
> index 7d73477..35fb366 100644
> --- a/libxfs/rdwr.c
> +++ b/libxfs/rdwr.c
> @@ -411,6 +411,7 @@ __initbuf(xfs_buf_t *bp, struct xfs_buftarg *btp, xfs_daddr_t bno,
>  			strerror(errno));
>  		exit(1);
>  	}
> +	memset(bp->b_addr, 0, bytes);
>  #ifdef XFS_BUF_TRACING
>  	list_head_init(&bp->b_lock_list);
>  #endif
> 
> _______________________________________________
> xfs mailing list
> xfs at oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs



More information about the xfs mailing list