54a53a006e
In scsi_disk_emulate_write_same() the number of host sectors to transfer is calculated as (s->qdev.blocksize / BDRV_SECTOR_SIZE) which is then used to copy data in block size chunks to the iov buffer. Since the loop copying the data to the iov buffer uses a fixed increment of s->qdev.blocksize then using a block size that isn't a multiple of BDRV_SECTOR_SIZE introduces a rounding error in the iov buffer size calculation such that the iov buffer copy overflows the space allocated. Update the iov buffer copy for() loop so that it will use the smallest of either the current block size or the remaining transfer count to prevent the overflow. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Message-Id: <20220730122656.253448-2-mark.cave-ayland@ilande.co.uk> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> |
||
---|---|---|
.. | ||
emulation.c | ||
esp-pci.c | ||
esp.c | ||
Kconfig | ||
lsi53c895a.c | ||
megasas.c | ||
meson.build | ||
mfi.h | ||
mpi.h | ||
mptconfig.c | ||
mptendian.c | ||
mptsas.c | ||
mptsas.h | ||
scsi-bus.c | ||
scsi-disk.c | ||
scsi-generic.c | ||
spapr_vscsi.c | ||
srp.h | ||
trace-events | ||
trace.h | ||
vhost-scsi-common.c | ||
vhost-scsi.c | ||
vhost-user-scsi.c | ||
viosrp.h | ||
virtio-scsi-dataplane.c | ||
virtio-scsi.c | ||
vmw_pvscsi.c | ||
vmw_pvscsi.h |