vhost: fix potential use-after-free for zero copy mbuf
authorTiwei Bie <tiwei.bie@intel.com>
Fri, 22 Feb 2019 02:42:07 +0000 (10:42 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 1 Mar 2019 17:17:36 +0000 (18:17 +0100)
commitd767436ee5d26d1d417ae17d1a2a47879bf632a6
tree9b23187e312cc1f8fcf41c2e9418065b9e237e08
parent041d37b2ef25faeb1c00ed70a5fc2ea6e93c4828
vhost: fix potential use-after-free for zero copy mbuf

Don't free the zero copy mbufs before they have been consumed,
otherwise there could be use-after-free.

Fixes: b0a985d1f340 ("vhost: add dequeue zero copy")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/vhost.h
lib/librte_vhost/vhost_user.c
lib/librte_vhost/virtio_net.c