vhost/scsi: fix reuse of &vq->iov[out] in response
authorBenjamin Coddington <bcodding@redhat.com>
Mon, 6 Jun 2016 22:07:59 +0000 (18:07 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2016 06:27:53 +0000 (08:27 +0200)
commit9cb2e06aa5ce916bd77cb1c4ec75cbb2a3d0b736
tree0481a5771c05d5944950b2b4c97860c8fefc74ee
parent2d64cbc819b13ebd503780f39552827516f4ce4a
vhost/scsi: fix reuse of &vq->iov[out] in response

commit a77ec83a57890240c546df00ca5df1cdeedb1cc3 upstream.

The address of the iovec &vq->iov[out] is not guaranteed to contain the scsi
command's response iovec throughout the lifetime of the command.  Rather, it
is more likely to contain an iovec from an immediately following command
after looping back around to vhost_get_vq_desc().  Pass along the iovec
entirely instead.

Fixes: 79c14141a487 ("vhost/scsi: Convert completion path to use copy_to_iter")
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/vhost/scsi.c