vhost: check ring descriptor address
authorIlya Maximets <i.maximets@samsung.com>
Fri, 15 Jul 2016 11:15:05 +0000 (14:15 +0300)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 15 Jul 2016 20:12:37 +0000 (22:12 +0200)
commitebd02c060abddfa1a5cf971c05c8ebc65b70bbd6
tree854b9d9108c2a28404537caa42bcf958ffe32df6
parent8729de6092cac2f4945c6bd81c997e8e1d41ed2b
vhost: check ring descriptor address

In current implementation vhost will crash with segmentation fault
if malicious or buggy virtio application breaks addresses of descriptors.

Before commit 0823c1cb0a73 ("vhost: workaround stale vring base")
this crash was reproducible even with normal DPDK application that tries
to change number of virtqueues dynamically inside VM.

Fix that by checking addresses of descriptors before using.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/vhost_rxtx.c