From bab25cb7a7e2b042926748a96cadc386e3de6c6a Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 4 Nov 2014 11:47:30 -0500 Subject: [PATCH] libext2fs: zero the EA block buffer before filling it When writing an extended attribute (EA) block, it's quite possible that the EA formatting code will not write the entire buffer. Therefore, we must zero the buffer beforehand to avoid writing random heap contents to disk. Signed-off-by: Darrick J. Wong Reported-by: Sami Liedes Signed-off-by: Theodore Ts'o --- lib/ext2fs/ext_attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ext2fs/ext_attr.c b/lib/ext2fs/ext_attr.c index b52abb5be..c397e00a0 100644 --- a/lib/ext2fs/ext_attr.c +++ b/lib/ext2fs/ext_attr.c @@ -550,7 +550,7 @@ errcode_t ext2fs_xattrs_write(struct ext2_xattr_handle *handle) write_ea_block: /* Write the EA block */ - err = ext2fs_get_mem(handle->fs->blocksize, &block_buf); + err = ext2fs_get_memzero(handle->fs->blocksize, &block_buf); if (err) goto out; -- 2.47.3