vhost: fix potential use-after-free for memory region
authorTiwei Bie <tiwei.bie@intel.com>
Fri, 22 Feb 2019 02:42:08 +0000 (10:42 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 1 Mar 2019 17:17:36 +0000 (18:17 +0100)
commit2a2904fa9cc44493bcea495bab944b032b24f7cb
tree0b60a48a0b4864fae2fee121223e0291f464f6e3
parentd767436ee5d26d1d417ae17d1a2a47879bf632a6
vhost: fix potential use-after-free for memory region

Reclaim outstanding zmbufs first before freeing memory regions,
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