]> git.itanic.dy.fi Git - linux-stable/commit
vsock/virtio: initialize the_virtio_vsock before using VQs
authorAlexandru Matei <alexandru.matei@uipath.com>
Tue, 24 Oct 2023 19:17:42 +0000 (22:17 +0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 25 Oct 2023 22:49:47 +0000 (15:49 -0700)
commit53b08c4985158430fd6d035fb49443bada535210
tree1332eda9a284020639cdbe00b75d99bc5bb774bc
parent1711435e3e67e079d6a2bce54d96d1af21c7ef2c
vsock/virtio: initialize the_virtio_vsock before using VQs

Once VQs are filled with empty buffers and we kick the host, it can send
connection requests. If the_virtio_vsock is not initialized before,
replies are silently dropped and do not reach the host.

virtio_transport_send_pkt() can queue packets once the_virtio_vsock is
set, but they won't be processed until vsock->tx_run is set to true. We
queue vsock->send_pkt_work when initialization finishes to send those
packets queued earlier.

Fixes: 0deab087b16a ("vsock/virtio: use RCU to avoid use-after-free on the_virtio_vsock")
Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20231024191742.14259-1-alexandru.matei@uipath.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/vmw_vsock/virtio_transport.c