vhost: fix potential fd leak
authorXuan Ding <xuan.ding@intel.com>
Mon, 18 May 2020 13:17:04 +0000 (14:17 +0100)
committerDavid Marchand <david.marchand@redhat.com>
Mon, 18 May 2020 13:22:42 +0000 (15:22 +0200)
commite7debf602633feb26227cdc8cc7fdd1b1b40946a
tree0ba6dae2b5f148f6fa5ce62c3fb2506342578ded
parent549de54c4f9fd36b2b11f3df7e81bf2567a2d526
vhost: fix potential fd leak

Vhost will create temporary file when receiving VHOST_USER_GET_INFLIGHT_FD
message. Malicious guest can send endless this message to drain out the
resource of host.

When receiving VHOST_USER_GET_INFLIGHT_FD message repeatedly, closing the
file created during the last handling of this message.

CVE-2020-10726
Fixes: d87f1a1cb7b666550 ("vhost: support inflight info sharing")
Cc: stable@dpdk.org
Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/vhost_user.c