From: Tiwei Bie Date: Fri, 4 Jan 2019 04:06:40 +0000 (+0800) Subject: vhost: fix possible out of bound access in vector filling X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=06fc8545fd6302f70de9ef5008a204e467d8cedb;p=dpdk.git vhost: fix possible out of bound access in vector filling Fixes: 7f74b95c444f ("vhost: pre update used ring for Tx and Rx") Cc: stable@dpdk.org Signed-off-by: Tiwei Bie Reviewed-by: Maxime Coquelin --- diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 474acf64dd..d64c355b98 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -312,6 +312,9 @@ fill_vec_buf_split(struct virtio_net *dev, struct vhost_virtqueue *vq, struct vring_desc *descs = vq->desc; struct vring_desc *idesc = NULL; + if (unlikely(idx >= vq->size)) + return -1; + *desc_chain_head = idx; if (vq->desc[idx].flags & VRING_DESC_F_INDIRECT) {