summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2016-01-25 12:44:17 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2016-01-25 12:44:17 +0000
commitd0f65262a005fdcf4d3220e1e376a3066552a305 (patch)
tree7a8d6dccd56c2e6c420fa24f41c6e4f4e3dd2b1a /sys/arch
parent3c10a88ff6a7d15890670e297448978e977bb54a (diff)
Zero when malloc'ing a buffer to be copyed out to userland to avoid
an information leak when not all of the buffer is written to. ok mlarkin@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/amd64/vmm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c
index 67056fe7b67..8e5fe5cff3f 100644
--- a/sys/arch/amd64/amd64/vmm.c
+++ b/sys/arch/amd64/amd64/vmm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm.c,v 1.31 2016/01/10 18:18:25 stefan Exp $ */
+/* $OpenBSD: vmm.c,v 1.32 2016/01/25 12:44:16 jsg Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -2372,7 +2372,7 @@ vm_get_info(struct vm_info_params *vip)
return (0);
}
- out = malloc(need, M_DEVBUF, M_NOWAIT);
+ out = malloc(need, M_DEVBUF, M_NOWAIT|M_ZERO);
if (out == NULL) {
vip->vip_info_ct = 0;
rw_exit_read(&vmm_softc->vm_lock);