vsock/virtio: suppress used length validation
Subsystems (6)
Michael S. Tsirkin
maintainerPATCH 1/1 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.
--- net/vmw_vsock/virtio_transport.c | 1 + 1 file changed, 1 insertion(+)
net/vmw_vsock/virtio_transport.c +1 -0
@@ -731,6 +731,7 @@ static unsigned int features[] = {static struct virtio_driver virtio_vsock_driver = { .feature_table = features, .feature_table_size =ARRAY_SIZE (features), + .suppress_used_validation = true, .driver.name =KBUILD_MODNAME , .driver.owner =THIS_MODULE , .id_table = id_table,
Signature · 1 line
MST
Quoted 10 lines · Michael S. Tsirkin
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_transportvirtio1: tx: used len 44 is larger than in buflen 0Since 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.
Quoted 7 lines
Reported-by Halil Pasic <[email protected]>Fixes 939779f5152d ("virtio_ring: validate used buffer length")Cc "Jason Wang" <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
net/vmw_vsock/virtio_transport.c| 1 +1 file changed, 1 insertion(+)
Thanks for this fix
I think we should also fix vhost-vsock violation (in stable branches too). @Halil do you plan to send a fix? Otherwise I can do it ;-)
Thanks,
Stefano
Quoted 10 lines · Michael S. Tsirkin
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_transportvirtio1: tx: used len 44 is larger than in buflen 0Since 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.
Quoted 7 lines
Reported-by Halil Pasic <[email protected]>Fixes 939779f5152d ("virtio_ring: validate used buffer length")Cc "Jason Wang" <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>--- net/vmw_vsock/virtio_transport.c | 1 + 1 file changed, 1 insertion(+)
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization