vhost: fix possible out of bound access in vector filling
Fixes: 7f74b95c44
("vhost: pre update used ring for Tx and Rx")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
This commit is contained in:
parent
4e282bc6c5
commit
06fc8545fd
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user