]> git.baikalelectronics.ru Git - kernel.git/commit
vsock/virtio: fix multiple packet delivery to monitoring devices
authorStefano Garzarella <sgarzare@redhat.com>
Fri, 24 Apr 2020 15:08:30 +0000 (17:08 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Apr 2020 17:18:01 +0000 (10:18 -0700)
commit99c7f0095d83d24265bad65e108b4dc17a61754c
treec62b88df77025e92bf501e3e622de84970b81958
parent4eb1feb00f03b5dab755a4a420da16d3ecbaa8a0
vsock/virtio: fix multiple packet delivery to monitoring devices

In virtio_transport.c, if the virtqueue is full, the transmitting
packet is queued up and it will be sent in the next iteration.
This causes the same packet to be delivered multiple times to
monitoring devices.

We want to continue to deliver packets to monitoring devices before
it is put in the virtqueue, to avoid that replies can appear in the
packet capture before the transmitted packet.

This patch fixes the issue, adding a new flag (tap_delivered) in
struct virtio_vsock_pkt, to check if the packet is already delivered
to monitoring devices.

In vhost/vsock.c, we are splitting packets, so we must set
'tap_delivered' to false when we queue up the same virtio_vsock_pkt
to handle the remaining bytes.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/vhost/vsock.c
include/linux/virtio_vsock.h
net/vmw_vsock/virtio_transport_common.c