Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Sep 2024 13:00:14 GMT
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 94693ec7c853 - main - bhyve: initialize register value
Message-ID:  <202409271300.48RD0Em6095732@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=94693ec7c85363f9b0098247489cea3efdb183f9

commit 94693ec7c85363f9b0098247489cea3efdb183f9
Author:     Pierre Pronchery <pierre@freebsdfoundation.org>
AuthorDate: 2024-07-24 19:33:26 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-09-27 12:59:36 +0000

    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
---
 sys/amd64/vmm/vmm_ioport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/amd64/vmm/vmm_ioport.c b/sys/amd64/vmm/vmm_ioport.c
index f036841f4e10..fc1ecab9f209 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;
 
 	/*


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202409271300.48RD0Em6095732>