s390x: fix storage attributes migration for non-small guests
commit46fa893355e0bd88f3c59b886f0d75cbd5f0bbbe
authorClaudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Thu, 18 Jan 2018 17:51:44 +0000 (18 18:51 +0100)
committerCornelia Huck <cohuck@redhat.com>
Mon, 22 Jan 2018 10:04:52 +0000 (22 11:04 +0100)
treed8905fb1fcae72e84e2ecbed1f968308887a45da
parent74a69e03c11412f4f3356f8ebc14339e5b1130ca
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@nongnu.org
Signed-off-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Fixes: 903fd80b03243476 ("s390x/migration: Storage attributes device")
Message-Id: <1516297904-18188-1-git-send-email-imbrenda@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
hw/s390x/s390-stattrib-kvm.c