[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PULL 5/9] s390x: fix storage attributes migration for non-
From: |
Cornelia Huck |
Subject: |
[qemu-s390x] [PULL 5/9] s390x: fix storage attributes migration for non-small guests |
Date: |
Mon, 22 Jan 2018 13:00:41 +0100 |
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>
---
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.13.6
- [qemu-s390x] [PULL 0/9] s390x update, Cornelia Huck, 2018/01/22
- [qemu-s390x] [PULL 1/9] s390x/sclp: fixup highest CPU address, Cornelia Huck, 2018/01/22
- [qemu-s390x] [PULL 3/9] s390x/sclp: fix missing be conversion, Cornelia Huck, 2018/01/22
- [qemu-s390x] [PULL 2/9] s390x/tcg: implement TEST PROTECTION, Cornelia Huck, 2018/01/22
- [qemu-s390x] [PULL 5/9] s390x: fix storage attributes migration for non-small guests,
Cornelia Huck <=
- [qemu-s390x] [PULL 4/9] hw/s390x: Replace fprintf(stderr, "*\n" with qemu_log_mask(), Cornelia Huck, 2018/01/22
- [qemu-s390x] [PULL 6/9] s390x/tcg: fixup TEST PROTECTION, Cornelia Huck, 2018/01/22
- [qemu-s390x] [PULL 7/9] linux-headers: update, Cornelia Huck, 2018/01/22
- [qemu-s390x] [PULL 9/9] s390x/kvm: provide stfle.81, Cornelia Huck, 2018/01/22
- [qemu-s390x] [PULL 8/9] s390x/kvm: Handle bpb feature, Cornelia Huck, 2018/01/22
- Re: [qemu-s390x] [PULL 0/9] s390x update, Peter Maydell, 2018/01/24