- ppc/xive: Fix ESB length overflow on 32-bit hosts - target/hppa: Fix PSW V-bit packaging in cpu_hppa_get for hppa64 - target/ppc: Fix migration of CPUs with TLB_EMB TLB type - target/arm: Clear high SVE elements in handle_vec_simd_wshli - module: Prevent crash by resetting local_err in module_load_qom_all() - tests/docker: update debian i686 and mipsel images to bookworm - target/arm: Fix SVE SDOT/UDOT/USDOT (4-way, indexed) - docs/sphinx/depfile.py: Handle env.doc2path() returning a Path not a str - block/blkio: use FUA flag on write zeroes only if supported - virtio-pci: Fix the use of an uninitialized irqfd - hw/cxl: Ensure there is enough data to read the input header in cmd_get_physical_port_state() - intel_iommu: Send IQE event when setting reserved bit in IQT_TAIL - virtio-net: Avoid indirection_table_mask overflow - Fix calculation of minimum in colo_compare_tcp - target/riscv/csr.c: Fix an access to VXSAT - linux-user: Clean up unused header - raw-format: Fix error message for invalid offset/size - hw/loongarch/virt: Remove unnecessary 'cpu.h' inclusion - tests: Wait for migration completion on destination QEMU to avoid failures - acpi: ged: Add macro for acpi sleep control register - hw/intc/openpic: Improve errors for out of bounds property values - hw/pci-bridge: Add a Kconfig switch for the normal PCI bridge - docs/tools/qemu-img.rst: fix typo (sumarizes) - audio/pw: Report more accurate error when connecting to PipeWire fails - audio/pw: Report more accurate error when connecting to PipeWire fails - dma: Fix function names in documentation Ensure the function names match. - edu: fix DMA range upper bound check - platform-bus: fix refcount leak - hw/net/can/sja1000: fix bug for single acceptance filter and standard frame - tests/avocado: fix typo in replay_linux - util/userfaultfd: Remove unused uffd_poll_events - Consider discard option when writing zeros - crypto: factor out conversion of QAPI to gcrypt constants - crypto: drop gnutls debug logging support - crypto: use consistent error reporting pattern for unsupported cipher modes - hw/gpio/aspeed_gpio: Avoid shift into sign bit Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com> (cherry picked from commit b6e04df301d30895427ab41a1edff0f40149bdd9)
49 lines
1.9 KiB
Diff
49 lines
1.9 KiB
Diff
From 16fb3ec642af7ec7980b7ceff1b25abee3fecee2 Mon Sep 17 00:00:00 2001
|
|
From: Susanooo <zhangchujun_yewu@cmss.chinamobile.com>
|
|
Date: Fri, 25 Oct 2024 09:20:38 +0800
|
|
Subject: [PATCH] raw-format: Fix error message for invalid offset/size
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
s->offset and s->size are only set at the end of the function and still
|
|
contain the old values when formatting the error message. Print the
|
|
parameters with the new values that we actually checked instead.
|
|
|
|
Fixes: 500e243 ('raw-format: Split raw_read_options()')
|
|
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
Message-ID: <20240829185527.47152-1-kwolf@redhat.com>
|
|
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
|
|
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
Signed-off-by: zhangchujun <zhangchujun_yewu@cmss.chinamobile.com>
|
|
---
|
|
block/raw-format.c | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/block/raw-format.c b/block/raw-format.c
|
|
index 1111dffd54..8195ed87cc 100644
|
|
--- a/block/raw-format.c
|
|
+++ b/block/raw-format.c
|
|
@@ -111,7 +111,7 @@ raw_apply_options(BlockDriverState *bs, BDRVRawState *s, uint64_t offset,
|
|
if (offset > real_size) {
|
|
error_setg(errp, "Offset (%" PRIu64 ") cannot be greater than "
|
|
"size of the containing file (%" PRId64 ")",
|
|
- s->offset, real_size);
|
|
+ offset, real_size);
|
|
return -EINVAL;
|
|
}
|
|
|
|
@@ -119,7 +119,7 @@ raw_apply_options(BlockDriverState *bs, BDRVRawState *s, uint64_t offset,
|
|
error_setg(errp, "The sum of offset (%" PRIu64 ") and size "
|
|
"(%" PRIu64 ") has to be smaller or equal to the "
|
|
" actual size of the containing file (%" PRId64 ")",
|
|
- s->offset, s->size, real_size);
|
|
+ offset, size, real_size);
|
|
return -EINVAL;
|
|
}
|
|
|
|
--
|
|
2.41.0.windows.1
|
|
|