summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstefan <stefan@openbsd.org>2016-02-23 17:15:09 +0000
committerstefan <stefan@openbsd.org>2016-02-23 17:15:09 +0000
commit078c9ec0315a65c496c787d5628de9288d98494f (patch)
tree5624634814d259a7392bc82fe42a772ef09e3d00
parentI just stumbled on this and noticed that eigrpd requires inet and rpath in pledge(2) call to make "reload", (diff)
downloadwireguard-openbsd-078c9ec0315a65c496c787d5628de9288d98494f.tar.xz
wireguard-openbsd-078c9ec0315a65c496c787d5628de9288d98494f.zip
Plug memleak: make sure that the MSR bitmap is freed in the VCPU init
error path. ok mlarkin@, deraadt@
-rw-r--r--sys/arch/amd64/amd64/vmm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c
index 0b5f39f33f2..87e90845c93 100644
--- a/sys/arch/amd64/amd64/vmm.c
+++ b/sys/arch/amd64/amd64/vmm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm.c,v 1.36 2016/02/20 20:49:08 mlarkin Exp $ */
+/* $OpenBSD: vmm.c,v 1.37 2016/02/23 17:15:09 stefan Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -2000,6 +2000,9 @@ exit:
if (vcpu->vc_control_va)
km_free((void *)vcpu->vc_control_va, PAGE_SIZE,
&kv_page, &kp_zero);
+ if (vcpu->vc_msr_bitmap_pa)
+ km_free((void *)vcpu->vc_msr_bitmap_pa, PAGE_SIZE,
+ &kv_page, &kp_zero);
if (vcpu->vc_vmx_msr_exit_save_va)
km_free((void *)vcpu->vc_vmx_msr_exit_save_va,
PAGE_SIZE, &kv_page, &kp_zero);