- qga/win32: Use rundll for VSS installation - qga/win32: Remove change action from MSI installer - ide: Increment BB in-flight counter for TRIM BH - hw/pci-bridge/pxb: Fix missing swizzle - host-vdpa: make notifiers _init()/_uninit() symmetric - hw/virtio: vdpa: Fix leak of host-notifier memory-region - accel/tcg/cpu-exec: Fix precise single-stepping after interrupt - Allow setting up to 8 bytes with the generic loader - hw/net/virtio-net: make some VirtIONet const - accel/tcg: Optimize jump cache flush during tlb range flush - 9pfs: prevent opening special files (CVE-2023-2861) - tcg: Reduce tcg_assert_listed_vecop() scope - gitlab: Disable plugins for cross-i386-tci - vfio/pci: Fix a segfault in vfio_realize - block/iscsi: fix double-free on BUSY or similar statuses - tests/tcg: fix unused variable in linux-test - hw/net/vmxnet3: allow VMXNET3_MAX_MTU itself as a value - qga/vss-win32: fix warning for clang++-15 - vnc: avoid underflow when accessing user-provided address - block/monitor: Fix crash when executing HMP commit - virtio-gpu: add a FIXME for virtio_gpu_load() - hw/ppc/Kconfig: MAC_NEWWORLD should always select USB_OHCI_PCI - migration: report compress thread pid to libvirt Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com>
49 lines
1.8 KiB
Diff
49 lines
1.8 KiB
Diff
From baf464ea0c35f9b235e8385b0771392ce362a6ec Mon Sep 17 00:00:00 2001
|
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
|
Date: Fri, 21 Jul 2023 06:14:37 +0000
|
|
Subject: [PATCH] Allow setting up to 8 bytes with the generic loader mainline
|
|
inclusion commit f42483d776bce29a9925ed61cc10eb27a5b2446c category: bugfix
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
---------------------------------------------------------------
|
|
|
|
The documentation for the generic loader says that "the maximum size of
|
|
the data is 8 bytes". However, attempts to set data-len=8 trigger the
|
|
following assertion failure:
|
|
|
|
../hw/core/generic-loader.c:59: generic_loader_reset: Assertion `s->data_len < sizeof(s->data)' failed.
|
|
|
|
The type of s->data is uint64_t (i.e. 8 bytes long), so I believe this
|
|
assert should use <= instead of <.
|
|
|
|
Fixes: e481a1f63c93 ("generic-loader: Add a generic loader")
|
|
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
|
|
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
|
|
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
|
|
Message-id: 20220120092715.7805-1-ptesarik@suse.com
|
|
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
|
|
|
|
Signed-off-by: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
|
---
|
|
hw/core/generic-loader.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c
|
|
index 9a24ffb880..504ed7ca72 100644
|
|
--- a/hw/core/generic-loader.c
|
|
+++ b/hw/core/generic-loader.c
|
|
@@ -56,7 +56,7 @@ static void generic_loader_reset(void *opaque)
|
|
}
|
|
|
|
if (s->data_len) {
|
|
- assert(s->data_len < sizeof(s->data));
|
|
+ assert(s->data_len <= sizeof(s->data));
|
|
dma_memory_write(s->cpu->as, s->addr, &s->data, s->data_len,
|
|
MEMTXATTRS_UNSPECIFIED);
|
|
}
|
|
--
|
|
2.41.0.windows.1
|
|
|