vhost: fix async vector buffer overrun
authorPatrick Fu <patrick.fu@intel.com>
Tue, 13 Oct 2020 01:45:45 +0000 (09:45 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 16 Oct 2020 17:48:19 +0000 (19:48 +0200)
commit3e1e9c24648a44f10c4e3f04f016cdb881535218
treeea2178921f2cadd203aa3bbe64b1882adc3733a4
parent9287d3a5a71a434e493fd6b01d20d30ea3706ffd
vhost: fix async vector buffer overrun

Add check on the async vector buffer usage to prevent the buf overrun.
If the unused vector buffer is not sufficient to prepare for next
packet's iov creation, an async transfer will be triggered immediately
to free the vector buffer.

Fixes: 78639d54563a ("vhost: introduce async enqueue registration API")
Cc: stable@dpdk.org
Signed-off-by: Patrick Fu <patrick.fu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/vhost.h
lib/librte_vhost/virtio_net.c