From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH 2/3] vhost: fix crash and fd leak due to vhostuser destroyed Date: Fri, 4 May 2018 17:11:42 +0200 Message-ID: <98a7f78c-d804-cbcb-7f4e-61b3f0c95297@redhat.com> References: <1524842385-61707-1-git-send-email-xiangxia.m.yue@gmail.com> <1524842385-61707-2-git-send-email-xiangxia.m.yue@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, stable@dpdk.org To: xiangxia.m.yue@gmail.com, jianfeng.tan@intel.com, yliu@fridaylinux.org Return-path: In-Reply-To: <1524842385-61707-2-git-send-email-xiangxia.m.yue@gmail.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 04/27/2018 05:19 PM, xiangxia.m.yue@gmail.com wrote: > From: Tonghao Zhang > > 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@dpdk.org > Signed-off-by: Tonghao Zhang > --- > lib/librte_vhost/socket.c | 41 ++++++++++++++++++++++++++++------------- > 1 file changed, 28 insertions(+), 13 deletions(-) > Applied to dpdk-next-virtio/master. Thanks, Maxime