diff options
author | Alan Somers <asomers@FreeBSD.org> | 2018-02-04 14:49:55 +0000 |
---|---|---|
committer | Alan Somers <asomers@FreeBSD.org> | 2018-02-04 14:49:55 +0000 |
commit | f5b4099e6b72fd7ac9f620c389229a9a4bf09992 (patch) | |
tree | cc6486cf8b057ab5af16a6d048aa58e09d11dcd8 /sbin/geom/class/raid3/geom_raid3.c | |
parent | aa3c83c3c6431c02c8c30318e9602b5e79ebe06e (diff) | |
download | src-f5b4099e6b72fd7ac9f620c389229a9a4bf09992.tar.gz src-f5b4099e6b72fd7ac9f620c389229a9a4bf09992.zip |
geom: don't write stack garbage in disk labels
Most consumers of g_metadata_store were passing in partially unallocated
memory, resulting in stack garbage being written to disk labels. Fix them by
zeroing the memory first.
gvirstor repeated the same mistake, but in the kernel.
Also, glabel's label contained a fixed-size string that wasn't
initialized to zero.
PR: 222077
Reported by: Maxim Khitrov <max@mxcrypt.com>
Reviewed by: cem
MFC after: 3 weeks
X-MFC-With: 323314
X-MFC-With: 323338
Differential Revision: https://reviews.freebsd.org/D14164
Notes
Notes:
svn path=/head/; revision=328849
Diffstat (limited to 'sbin/geom/class/raid3/geom_raid3.c')
-rw-r--r-- | sbin/geom/class/raid3/geom_raid3.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sbin/geom/class/raid3/geom_raid3.c b/sbin/geom/class/raid3/geom_raid3.c index 1ad347dae384..17d3187d5cf4 100644 --- a/sbin/geom/class/raid3/geom_raid3.c +++ b/sbin/geom/class/raid3/geom_raid3.c @@ -151,6 +151,7 @@ raid3_label(struct gctl_req *req) int hardcode, round_robin, verify; int error, i, nargs; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs < 4) { gctl_error(req, "Too few arguments."); |