[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.1.2 09/58] raw-format: Fix error message for invalid offset/si
From: |
Michael Tokarev |
Subject: |
[Stable-9.1.2 09/58] raw-format: Fix error message for invalid offset/size |
Date: |
Sat, 9 Nov 2024 15:08:10 +0300 |
From: Kevin Wolf <kwolf@redhat.com>
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: 500e2434207d ('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>
(cherry picked from commit 04bbc3ee52b32ac465547bb40c1f090a1b8f315a)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/block/raw-format.c b/block/raw-format.c
index ac7e8495f6..e08526e2ec 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.39.5
- [Stable-9.1.2 00/58] Patch Round-up for stable 9.1.2, freeze on 2024-11-18, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 01/58] tcg/s390x: fix constraint for 32-bit TSTEQ/TSTNE, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 02/58] KVM: Dynamic sized kvm memslots array, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 03/58] target/i386/tcg: Use DPL-level accesses for interrupts and call gates, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 04/58] accel/kvm: check for KVM_CAP_READONLY_MEM on VM, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 05/58] target/i386: Use only 16 and 32-bit operands for IN/OUT, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 06/58] tests: Wait for migration completion on destination QEMU to avoid failures, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 07/58] Revert "hw/sh4/r2d: Realize IDE controller before accessing it", Michael Tokarev, 2024/11/09
- [Stable-9.1.2 08/58] tests/qemu-iotests/211.out: Update to expect MapEntry 'compressed' field, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 09/58] raw-format: Fix error message for invalid offset/size,
Michael Tokarev <=
- [Stable-9.1.2 11/58] target/i386: Walk NPT in guest real mode, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 10/58] tcg: Reset data_gen_ptr correctly, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 14/58] linux-user/ppc: Fix sigmask endianness issue in sigreturn, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 13/58] linux-user: Emulate /proc/self/maps under mmap_lock, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 12/58] target/i386: Use probe_access_full_mmu in ptw_translate, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 18/58] dockerfiles: fix default targets for debian-loongarch-cross, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 15/58] linux-user/riscv: Fix definition of RISCV_HWPROBE_EXT_ZVFHMIN, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 17/58] gitlab: make check-[dco|patch] a little more verbose, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 16/58] vfio/migration: Report only stop-copy size in vfio_state_pending_exact(), Michael Tokarev, 2024/11/09
- [Stable-9.1.2 24/58] target/arm: Don't assert in regime_is_user() for E10 mmuidx values, Michael Tokarev, 2024/11/09