1
0
Fork 0
alistair23-linux/drivers/vhost
Yunjian Wang 5c6eb887e1 vhost_net: fix ubuf refcount incorrectly when sendmsg fails
[ Upstream commit 01e31bea7e ]

Currently the vhost_zerocopy_callback() maybe be called to decrease
the refcount when sendmsg fails in tun. The error handling in vhost
handle_tx_zerocopy() will try to decrease the same refcount again.
This is wrong. To fix this issue, we only call vhost_net_ubuf_put()
when vq->heads[nvq->desc].len == VHOST_DMA_IN_PROGRESS.

Fixes: bab632d69e ("vhost: vhost TX zero-copy support")
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/1609207308-20544-1-git-send-email-wangyunjian@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-12 20:16:16 +01:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Kconfig.vringh treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
net.c vhost_net: fix ubuf refcount incorrectly when sendmsg fails 2021-01-12 20:16:16 +01:00
scsi.c vhost scsi: fix cmd completion race 2020-12-02 08:49:48 +01:00
test.c vhost/test: stop device before reset 2019-10-13 09:38:27 -04:00
test.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vhost.c vhost: Use vhost_get_used_size() in vhost_vring_set_addr() 2020-10-14 10:32:58 +02:00
vhost.h Revert "vhost: access vq metadata through kernel virtual address" 2019-09-04 07:39:48 -04:00
vringh.c vringh: fix __vringh_iov() when riov and wiov are different 2020-11-05 11:43:35 +01:00
vsock.c vsock/virtio: add transport parameter to the virtio_transport_reset_no_sock() 2020-10-07 08:01:24 +02:00