linux/drivers/s390/kvm
Cornelia Huck 431dae778a KVM: s390: virtio-ccw: don't overwrite config space values
Eric noticed problems with vhost-scsi and virtio-ccw: vhost-scsi
complained about overwriting values in the config space, which
was triggered by a broken implementation of virtio-ccw's config
get/set routines. It was probably sheer luck that we did not hit
this before.

When writing a value to the config space, the WRITE_CONF ccw will
always write from the beginning of the config space up to and
including the value to be set. If the config space up to the value
has not yet been retrieved from the device, however, we'll end up
overwriting values. Keep track of the known config space and update
if needed to avoid this.

Moreover, READ_CONF will only read the number of bytes it has been
instructed to retrieve, so we must not copy more than that to the
buffer, or we might overwrite trailing values.

Reported-by: Eric Farman <farman@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Eric Farman <farman@linux.vnet.ibm.com>
Tested-by: Eric Farman <farman@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-07-03 18:55:18 +02:00
..
Makefile KVM: s390: Add a channel I/O based virtio transport driver. 2012-12-18 14:37:13 +02:00
kvm_virtio.c s390/sclp: unify basic sclp access by exposing "struct sclp" 2015-05-13 09:58:17 +02:00
virtio_ccw.c KVM: s390: virtio-ccw: don't overwrite config space values 2015-07-03 18:55:18 +02:00