vhost: fix vring requests validation broken if no FD
authorZhike Wang <wangzk320@163.com>
Wed, 13 Nov 2019 11:03:28 +0000 (19:03 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Fri, 15 Nov 2019 13:25:48 +0000 (14:25 +0100)
commit1407b0752eee2353160701d0182c7e911ccb538a
tree6c7a190af5a0be29822dacb29d9959465d6e94d3
parentf43d3dbbd90c9e195d26d18ac7da9ca2854c3f1e
vhost: fix vring requests validation broken if no FD

When VHOST_USER_VRING_NOFD_MASK is set, the fd_num is 0,
so validate_msg_fds() will return error. In this case,
the negotiation of vring message between vhost user front end and
back end would fail, and as a result, vhost user link could NOT be up.

How to reproduce:
1.Run dpdk testpmd insides VM, which locates at host with ovs+dpdk.
2.Notice that inside ovs there are endless logs regarding failure to
handle VHOST_USER_SET_VRING_CALL, and link of vm could NOT be up.

Fixes: bf472259dde6 ("vhost: fix possible denial of service by leaking FDs")
Cc: stable@dpdk.org
Signed-off-by: Zhike Wang <wangzk320@163.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
lib/librte_vhost/vhost_user.c