]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 23 Aug 2016 14:16:57 +0000 (17:16 +0300)
commit40740e510a947238a1fc14bde341d94a3670a63d
treefe37edca9e7e94664939a1e6ad3605501d55ccf7
parent1fa859b2de8f1ef05332f907c6e06d634c23731e
vhost/scsi: fix reuse of &vq->iov[out] in response

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: 1b68b4c6de34 ("vhost/scsi: Convert completion path to use copy_to_iter")
Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/scsi.c