[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-xen master] s390x: fix storage attributes migration for non-small guests



commit e7857ad9975400ef4a35237a92e21bc3c6bfd464
Author:     Claudio Imbrenda <imbrenda@xxxxxxxxxxxxxxxxxx>
AuthorDate: Thu Jan 18 18:51:44 2018 +0100
Commit:     Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
CommitDate: Mon Jan 29 08:28:08 2018 -0600

    s390x: fix storage attributes migration for non-small guests
    
    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: qemu-stable@xxxxxxxxxx
    Signed-off-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxxxxxxx>
    Fixes: 903fd80b03243476 ("s390x/migration: Storage attributes device")
    Message-Id: <1516297904-18188-1-git-send-email-imbrenda@xxxxxxxxxxxxxxxxxx>
    Reviewed-by: Christian Borntraeger <borntraeger@xxxxxxxxxx>
    Signed-off-by: Cornelia Huck <cohuck@xxxxxxxxxx>
    (cherry picked from commit 46fa893355e0bd88f3c59b886f0d75cbd5f0bbbe)
    Signed-off-by: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
---
 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 41770a7..480551c 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));
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.