Skip to content

Commit

Permalink
bhyve: initialize register value
Browse files Browse the repository at this point in the history
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
  • Loading branch information
khorben authored and emaste committed Sep 27, 2024
1 parent 7fe4203 commit 94693ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sys/amd64/vmm/vmm_ioport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down

0 comments on commit 94693ec

Please sign in to comment.