linux-stable/drivers/vhost
Andrey Smetanin 5b43a641a2 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:14:23 +02:00
..
Kconfig vhost_vdpa: implement IRQ offloading in vhost_vdpa 2020-08-05 11:08:42 -04:00
Makefile vhost: introduce vDPA-based backend 2020-04-02 10:41:40 -04:00
iotlb.c vhost_iotlb: split out IOTLB initialization 2022-05-31 12:44:28 -04:00
net.c vhost_net: revert upend_idx only on retriable error 2023-06-28 11:14:23 +02:00
scsi.c vhost-scsi: Fix crash during LUN unmapping 2023-04-04 11:01:58 -04:00
test.c vhost-test: remove meaningless debug info 2023-02-20 19:26:58 -05:00
test.h tools/virtio: Add --reset 2020-06-22 12:34:21 -04:00
vdpa.c vhost_vdpa: tell vqs about the negotiated 2023-06-28 11:14:23 +02:00
vhost.c vhost: support PACKED when setting-getting vring_base 2023-06-14 11:17:04 +02:00
vhost.h vhost: support PACKED when setting-getting vring_base 2023-06-14 11:17:04 +02:00
vringh.c vringh: use bvec_set_page to initialize a bvec 2023-02-03 10:17:42 -07:00
vsock.c virtio,vhost,vdpa: features, fixes 2023-02-25 11:48:02 -08:00