public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] libxfs: don't write uninitialized heap contents into new directory blocks
@ 2015-03-19 23:55 Darrick J. Wong
  2015-03-20 11:52 ` Brian Foster
  0 siblings, 1 reply; 2+ messages in thread
From: Darrick J. Wong @ 2015-03-19 23:55 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Brian Foster, xfs

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@oracle.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@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-20 11:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-19 23:55 [PATCH v2] libxfs: don't write uninitialized heap contents into new directory blocks Darrick J. Wong
2015-03-20 11:52 ` Brian Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox