linux-stable/drivers/vhost
Stefano Garzarella 1e69422efc vringh: don't use vringh_kiov_advance() in vringh_iov_xfer()
commit 7aed44babc upstream.

In the while loop of vringh_iov_xfer(), `partlen` could be 0 if one of
the `iov` has 0 lenght.
In this case, we should skip the iov and go to the next one.
But calling vringh_kiov_advance() with 0 lenght does not cause the
advancement, since it returns immediately if asked to advance by 0 bytes.

Let's restore the code that was there before commit b8c06ad4d6
("vringh: implement vringh_kiov_advance()"), avoiding using
vringh_kiov_advance().

Fixes: b8c06ad4d6 ("vringh: implement vringh_kiov_advance()")
Cc: stable@vger.kernel.org
Reported-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-10 21:59:05 +02:00
..
iotlb.c
Kconfig
Makefile
net.c vhost_net: revert upend_idx only on retriable error 2023-06-28 10:29:53 +02:00
scsi.c
test.c
test.h
vdpa.c vhost_vdpa: support PACKED when setting-getting vring_base 2023-06-14 11:13:09 +02:00
vhost.c vhost: support PACKED when setting-getting vring_base 2023-06-14 11:13:09 +02:00
vhost.h vhost: support PACKED when setting-getting vring_base 2023-06-14 11:13:09 +02:00
vringh.c vringh: don't use vringh_kiov_advance() in vringh_iov_xfer() 2023-10-10 21:59:05 +02:00
vsock.c