linux-stable/drivers/vhost
Andrey Smetanin 6ab9468d3e vhost_net: revert upend_idx only on retriable error
[ Upstream commit 1f5d2e3bab ]

Fix possible virtqueue used buffers leak and corresponding stuck
in case of temporary -EIO from sendmsg() which is produced by
tun driver while backend device is not up.

In case of no-retriable error and zcopy do not revert upend_idx
to pass packet data (that is update used_idx in corresponding
vhost_zerocopy_signal_used()) as if packet data has been
transferred successfully.

v2: set vq->heads[ubuf->desc].len equal to VHOST_DMA_DONE_LEN
in case of fake successful transmit.

Signed-off-by: Andrey Smetanin <asmetanin@yandex-team.ru>
Message-Id: <20230424204411.24888-1-asmetanin@yandex-team.ru>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andrey Smetanin <asmetanin@yandex-team.ru>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-28 11:12:40 +02:00
..
iotlb.c vhost_iotlb: split out IOTLB initialization 2022-05-31 12:44:28 -04:00
Kconfig
Makefile
net.c vhost_net: revert upend_idx only on retriable error 2023-06-28 11:12:40 +02:00
scsi.c vhost-scsi: unbreak any layout for response 2023-02-09 11:28:04 +01:00
test.c vhost: rename vhost_work_dev_flush 2022-05-31 12:45:10 -04:00
test.h
vdpa.c vhost_vdpa: tell vqs about the negotiated 2023-06-28 11:12:39 +02:00
vhost.c vhost: support PACKED when setting-getting vring_base 2023-06-14 11:15:33 +02:00
vhost.h vhost: support PACKED when setting-getting vring_base 2023-06-14 11:15:33 +02:00
vringh.c use less confusing names for iov_iter direction initializers 2023-02-09 11:28:04 +01:00
vsock.c use less confusing names for iov_iter direction initializers 2023-02-09 11:28:04 +01:00