- sw_64: Added sw64 architecture related updates - virtio-crypto: verify src&dst buffer length for sym request - vhost-vdpa: do not cleanup the vdpa/vhost-net structures if peer nic is present - qga: Fix suspend on Linux guests without systemd - tests: vhost-user-test: release mutex on protocol violation - qapi: support updating expected test output via make - block: Fix misleading hexadecimal format - block/rbd: fix write zeroes with growing images - block/nbd.c: Fixed IO request coroutine not being wakeup when kill NBD server - block/nfs: Fix 32-bit Windows build - qapi/qdev: Tidy up device_add documentation - hw/xen/xen_pt: fix uninitialized variable - migration/ram: Fix error handling in ram_write_tracking_start() - docs/about/build-platforms: Refine the distro support policy - xen-block: Avoid leaks on new error path - QGA VSS: Add wrapper to send log to debugger and stderr - chardev/char-socket: set s->listener = NULL in char_socket_finalize - qapi/block: Tidy up block-latency-histogram-set documentation - disas/riscv Fix ctzw disassemble - vfio: Fix vfio_get_dev_region() trace event - migration/ram: Fix populate_read_range() - Check and report for incomplete 'global' option format Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com>
46 lines
1.7 KiB
Diff
46 lines
1.7 KiB
Diff
From 26bc780b9357bc50131242915175cf1db8c82b0e Mon Sep 17 00:00:00 2001
|
|
From: xiaowanghe <xiaowanghe_yewu@cmss.chinamobile.com>
|
|
Date: Tue, 1 Aug 2023 23:30:04 -0700
|
|
Subject: [PATCH] hw/xen/xen_pt: fix uninitialized variable
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
cherry picked from commit 3856734d80fbf46683e4080117ed961f5ab1300b
|
|
|
|
xen_pt_config_reg_init() reads only that many bytes as the size of the
|
|
register that is being initialized. It uses
|
|
xen_host_pci_get_{byte,word,long} and casts its last argument to
|
|
expected pointer type. This means for smaller registers higher bits of
|
|
'val' are not initialized. Then, the function fails if any of those
|
|
higher bits are set.
|
|
|
|
Fix this by initializing 'val' with zero.
|
|
|
|
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
|
|
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
|
|
Message-Id: <20230127050815.4155276-1-marmarek@invisiblethingslab.com>
|
|
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
|
|
|
|
Signed-off-by: Wanghe Xiao <xiaowanghe_yewu@cmss.chinamobile.com>
|
|
---
|
|
hw/xen/xen_pt_config_init.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c
|
|
index c5c4e943a8..e7bcbe4c4f 100644
|
|
--- a/hw/xen/xen_pt_config_init.c
|
|
+++ b/hw/xen/xen_pt_config_init.c
|
|
@@ -1924,7 +1924,7 @@ static void xen_pt_config_reg_init(XenPCIPassthroughState *s,
|
|
if (reg->init) {
|
|
uint32_t host_mask, size_mask;
|
|
unsigned int offset;
|
|
- uint32_t val;
|
|
+ uint32_t val = 0;
|
|
|
|
/* initialize emulate register */
|
|
rc = reg->init(s, reg_entry->reg,
|
|
--
|
|
2.41.0.windows.1
|
|
|