From: deraadt Date: Tue, 4 Apr 2017 18:17:02 +0000 (+0000) Subject: struct vfsconf is tightly packed, but let's M_ZERO it in case that ever X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6cb46c1dd374ad42e36e6a4844869ba44861c40f;p=openbsd struct vfsconf is tightly packed, but let's M_ZERO it in case that ever changes to avoid exposing userland memory. --- diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index a8a53052f66..8cdeb565922 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.257 2017/01/15 23:18:05 bluhm Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.258 2017/04/04 18:17:02 deraadt Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -1311,7 +1311,7 @@ vfs_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, return (EOPNOTSUPP); /* Make a copy, clear out kernel pointers */ - tmpvfsp = malloc(sizeof(*tmpvfsp), M_TEMP, M_WAITOK); + tmpvfsp = malloc(sizeof(*tmpvfsp), M_TEMP, M_WAITOK|M_ZERO); memcpy(tmpvfsp, vfsp, sizeof(*tmpvfsp)); tmpvfsp->vfc_vfsops = NULL; tmpvfsp->vfc_next = NULL;