vhost: check message header size read
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Wed, 5 Feb 2020 15:05:29 +0000 (16:05 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 14 Feb 2020 11:42:13 +0000 (12:42 +0100)
commit966f89d998a20eddb45666f06dd42a3c3fc94574
treeb049e2116d60715d8c604e87838bc9e8e995c2eb
parente21492a5175af31ae568fa5fabef1f4b22706962
vhost: check message header size read

This patch adds a check to ensure the read size of
the Vhost-user message header is not smaller than
the expected size.

In case of unexpected read size, report an error
and close file descriptors passed with the message,
if any.

Fixes: 8f972312b8f4 ("vhost: support vhost-user")
Cc: stable@dpdk.org
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
lib/librte_vhost/vhost_user.c