[PATCH net 3/4] vhost: vsock: add weight support

Stefan Hajnoczi
Thu, 16 May 2019 09:33:52 -0000

On Thu, May 16, 2019 at 03:47:41AM -0400, Jason Wang
wrote:
> @@ -183,7 +184,8 @@ static struct vhost_vsock *vhost_vsock_get(u32
guest_cid)
>  		virtio_transport_deliver_tap_pkt(pkt);
>
>  		virtio_transport_free_pkt(pkt);
> -	}
> +		total_len += pkt->len;

Please increment total_len before virtio_transport_free_pkt(pkt) to
avoid use-after-free.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL:
<http://lists.linuxfoundation.org/pipermail/virtualization/attachments/20190516/06ae5670/attachment.sig>