]> git.baikalelectronics.ru Git - kernel.git/commit
vsock/virtio: suppress used length validation
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 22 Nov 2021 09:32:01 +0000 (04:32 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Nov 2021 14:49:03 +0000 (14:49 +0000)
commitb73ce797f0ce67217a72d7347a44c33a50a53a05
tree57d0584f74b9b7e52b9809931d2c1dd57ac3f2dd
parent2895a981022856133b9a9557eaabce7a3d0cc3ce
vsock/virtio: suppress used length validation

It turns out that vhost vsock violates the virtio spec
by supplying the out buffer length in the used length
(should just be the in length).
As a result, attempts to validate the used length fail with:
vmw_vsock_virtio_transport virtio1: tx: used len 44 is larger than in buflen 0

Since vsock driver does not use the length fox tx and
validates the length before use for rx, it is safe to
suppress the validation in virtio core for this driver.

Reported-by: Halil Pasic <pasic@linux.ibm.com>
Fixes: f575a3e0ac95 ("virtio_ring: validate used buffer length")
Cc: "Jason Wang" <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/vmw_vsock/virtio_transport.c