Skip to content

Commit

Permalink
vhost: fix double-free with zero-copy
Browse files Browse the repository at this point in the history
[ upstream commit a608436 ]

zmbufs should be set to NULL when getting freed to avoid double free on
the same buffer pointer

Fixes: b0a985d ("vhost: add dequeue zero copy")

Signed-off-by: Patrick Fu <patrick.fu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
  • Loading branch information
Patrick Fu authored and kevintraynor committed Aug 27, 2020
1 parent 8df3f28 commit 59b99c4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/librte_vhost/vhost_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,7 @@ free_zmbufs(struct vhost_virtqueue *vq)
drain_zmbuf_list(vq);

rte_free(vq->zmbufs);
vq->zmbufs = NULL;
}

/*
Expand Down

0 comments on commit 59b99c4

Please sign in to comment.