Re: VIRTIO_VSOCK_OP_REQUEST with the same src_port from a guest

"Michael S. Tsirkin" <[email protected]> Mon, 1 Jul 2024 14:44:27 -0400
Newsgroups dev.linux.lists.virtio-dev
Message-ID <[email protected]>
On Mon, Jul 01, 2024 at 10:35:57AM -0700, Roman Kiryanov wrote:
> Hi virtio-dev,
> 
> we (Android Studio Emulator) have our own implementation of
> virtio-vsock and we recently found that the virtio spec does not cover
> the situation if a guest sends a VIRTIO_VSOCK_OP_REQUEST packet with
> the same src_port that is already registered on the device side.
> 
> This sounds like an error to me and I don't think I ever saw this
> happening, but it would be nice if the spec explicitly mentioned how
> this situation should be handled on the device side.
> 
> The spec does mention "A VIRTIO_VSOCK_OP_RST reply is sent if ... the
> destination has insufficient resources to establish the connection",
> but I am not sure if this includes the duplicate src_port case. I
> think this means the previously established connection will be broken.
> 
> Thank you.
> 
> Regards,
> Roman.

Another way is just to forbid this from happening.

How does this happen on the driver side?
-- 
MST