vhost: check overflow before mmap
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 5 Feb 2018 12:16:00 +0000 (13:16 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 30 Mar 2018 12:08:42 +0000 (14:08 +0200)
commit0fe99cf73eec0426ef9cb5eb71c1b8b4de40162c
treec74d79c863a1c00c46dc82a69e02cd952b76f9d4
parenteb7c574b21cc92792ea5a1f219ddf6dd3cf3b1e1
vhost: check overflow before mmap

If memory_size + mmap_offset overflows then the memory region is bogus.
Do not use the overflowed mmap_size value for mmap().

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/vhost_user.c