[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 27/54] s390x: fix storage attributes migration for n
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 27/54] s390x: fix storage attributes migration for non-small guests |
Date: |
Tue, 6 Feb 2018 13:14:48 -0600 |
From: Claudio Imbrenda <address@hidden>
Fix storage attribute migration so that it does not fail for guests
with more than a few GB of RAM.
With such guests, the index in the buffer would go out of bounds,
usually by large amounts, thus receiving -EFAULT from the kernel.
Migration itself would be successful, but storage attributes would then
not be migrated completely.
This patch fixes the out of bounds access, and thus migration of all
storage attributes when the guest have large amounts of memory.
Cc: address@hidden
Signed-off-by: Claudio Imbrenda <address@hidden>
Fixes: 903fd80b03243476 ("s390x/migration: Storage attributes device")
Message-Id: <address@hidden>
Reviewed-by: Christian Borntraeger <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
(cherry picked from commit 46fa893355e0bd88f3c59b886f0d75cbd5f0bbbe)
Signed-off-by: Michael Roth <address@hidden>
---
hw/s390x/s390-stattrib-kvm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/s390x/s390-stattrib-kvm.c b/hw/s390x/s390-stattrib-kvm.c
index 41770a7dec..480551c3db 100644
--- a/hw/s390x/s390-stattrib-kvm.c
+++ b/hw/s390x/s390-stattrib-kvm.c
@@ -116,7 +116,7 @@ static void kvm_s390_stattrib_synchronize(S390StAttribState
*sa)
for (cx = 0; cx + len <= max; cx += len) {
clog.start_gfn = cx;
clog.count = len;
- clog.values = (uint64_t)(sas->incoming_buffer + cx * len);
+ clog.values = (uint64_t)(sas->incoming_buffer + cx);
r = kvm_vm_ioctl(kvm_state, KVM_S390_SET_CMMA_BITS, &clog);
if (r) {
error_report("KVM_S390_SET_CMMA_BITS failed: %s",
strerror(-r));
@@ -126,7 +126,7 @@ static void kvm_s390_stattrib_synchronize(S390StAttribState
*sa)
if (cx < max) {
clog.start_gfn = cx;
clog.count = max - cx;
- clog.values = (uint64_t)(sas->incoming_buffer + cx * len);
+ clog.values = (uint64_t)(sas->incoming_buffer + cx);
r = kvm_vm_ioctl(kvm_state, KVM_S390_SET_CMMA_BITS, &clog);
if (r) {
error_report("KVM_S390_SET_CMMA_BITS failed: %s",
strerror(-r));
--
2.11.0
- [Qemu-devel] [PATCH 26/54] linux-user: Fix locking order in fork_start(), (continued)
- [Qemu-devel] [PATCH 26/54] linux-user: Fix locking order in fork_start(), Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 23/54] i386: Add FEAT_8000_0008_EBX CPUID feature word, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 22/54] i386: Add spec-ctrl CPUID bit, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 21/54] i386: Add support for SPEC_CTRL MSR, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 20/54] i386: Change X86CPUDefinition::model_id to const char*, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 01/54] target/i386: Fix handling of VEX prefixes, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 28/54] linux-headers: update to 4.15-rc1, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 24/54] i386: Add new -IBRS versions of Intel CPU models, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 30/54] s390x/kvm: Handle bpb feature, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 29/54] linux-headers: update, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 27/54] s390x: fix storage attributes migration for non-small guests,
Michael Roth <=
- [Qemu-devel] [PATCH 33/54] usb-storage: Fix share-rw option parsing, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 35/54] linux-user/signal.c: Rename MC_* defines, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 38/54] spapr: Capabilities infrastructure, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 31/54] s390x/kvm: provide stfle.81, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 40/54] spapr: Validate capabilities on migration, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 43/54] spapr: Handle Decimal Floating Point (DFP) as an optional capability, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 37/54] spapr: Add pseries-2.12 machine type, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 02/54] block/iscsi: dont leave allocmap in an invalid state on UNMAP failure, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 34/54] spapr_pci: fix MSI/MSIX selection, Michael Roth, 2018/02/06
- [Qemu-devel] [PATCH 41/54] target/ppc: Clean up probing of VMX, VSX and DFP availability on KVM, Michael Roth, 2018/02/06