[dpdk-dev] [PATCH 2/3] vhost: fix crash and fd leak due to vhostuser destroyed

Maxime Coquelin maxime.coquelin at redhat.com
Fri May 4 17:11:42 CEST 2018



On 04/27/2018 05:19 PM, xiangxia.m.yue at gmail.com wrote:
> From: Tonghao Zhang <xiangxia.m.yue at gmail.com>
> 
> when rte_vhost_driver_unregister detstroy the vsocket, we
> should set it to NULL after freeing it, because in client mode,
> the conn may be added to reconnect thread while vsocket is
> destroyed. In one case, if qemu create vhostuser port as a
> server with the same unix path, the reconnect thread will
> reconnect to it while vsocket is destroyed.
> 
> To fix this:
> 1. set vsocket to NULL after free it.
> 2. remove the reconnection from reconnection thread in suitable
>     position.
> 
> Cc: stable at dpdk.org
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
> ---
>   lib/librte_vhost/socket.c | 41 ++++++++++++++++++++++++++++-------------
>   1 file changed, 28 insertions(+), 13 deletions(-)
> 

Applied to dpdk-next-virtio/master.

Thanks,
Maxime


More information about the dev mailing list