vhoat: potential crash in map_guest_mem using debug image 35/17035/4
authorSteven Luong <sluong@cisco.com>
Thu, 24 Jan 2019 06:20:19 +0000 (22:20 -0800)
committerDave Barach <openvpp@barachs.net>
Sat, 23 Feb 2019 12:43:44 +0000 (12:43 +0000)
commitb0789106cb4f4c7ac529c02a5ff1ac346f0913dd
tree4f97328ef710a5de1f5f8f127b9c6f64742c02a5
parent2cefb064045727a50e7e57cc00919389ce8d86ce
vhoat: potential crash in map_guest_mem using debug image

map_guest_mem may be called from worker-thread/dataplane. It has a call
to vlib_log and may crash inside vlib_log's ASSERT statement

  /* make sure we are running on the main thread to avoid use in dataplane
     code, for dataplane logging consider use of event-logger */
  ASSERT (vlib_get_thread_index () == 0);

The fix is to convert the vlib_log call in map_guest_map to event logger

Change-Id: Iaaf6d86782aa8a18d25e0209f22dc31f04668d56
Signed-off-by: Steven Luong <sluong@cisco.com>
src/vnet/devices/virtio/vhost_user_inline.h