vhost: reject invalid log base mmap offset
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)
commitf83e0199c80e108576a5f0c9e523fd338db35d58
tree1b8324c8823428cdcce36ee25f1c0d56b8eba628
parent2042cf7194e2143c992214b16ca8170b308e8d43
vhost: reject invalid log base mmap offset

If the log base mmap_offset is larger than mmap_size then it points
outside the mmap region.  We must not write to memory outside the mmap
region, so validate mmap_offset in vhost_user_set_log_base().

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