aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Pronchery <pierre@freebsdfoundation.org>2024-07-24 19:33:26 +0000
committerEd Maste <emaste@FreeBSD.org>2024-09-30 12:11:15 +0000
commita03acfa43410b3a449fa8d5b1dbba20e0bf02d5a (patch)
treea3a3129b5a565c09dbe057711aa1db560f2f98f1
parent70280bc71d28935346f7cc7c41ddd99e58b9604a (diff)
bhyve: initialize register value
In case of an error in a code pattern like ``` uint64_t val; error = memread(vcpu, gpa, &val, 1, arg); error = vie_update_register(vcpu, reg, val, size); ``` uninitialized stack data would be used. Reported by: Synacktiv Reviewed by: markj Security: HYP-21 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46107 (cherry picked from commit 94693ec7c85363f9b0098247489cea3efdb183f9)
-rw-r--r--sys/amd64/vmm/vmm_ioport.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/amd64/vmm/vmm_ioport.c b/sys/amd64/vmm/vmm_ioport.c
index ec270df80c3e..3caea7deac16 100644
--- a/sys/amd64/vmm/vmm_ioport.c
+++ b/sys/amd64/vmm/vmm_ioport.c
@@ -101,7 +101,7 @@ static int
emulate_inout_port(struct vcpu *vcpu, struct vm_exit *vmexit, bool *retu)
{
ioport_handler_func_t handler;
- uint32_t mask, val;
+ uint32_t mask, val = 0;
int error;
/*