From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id C9B202B82; Fri, 4 May 2018 17:11:44 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6A3EA427095F; Fri, 4 May 2018 15:11:44 +0000 (UTC) Received: from [10.36.112.52] (ovpn-112-52.ams2.redhat.com [10.36.112.52]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4DC542141200; Fri, 4 May 2018 15:11:43 +0000 (UTC) To: xiangxia.m.yue@gmail.com, jianfeng.tan@intel.com, yliu@fridaylinux.org Cc: dev@dpdk.org, stable@dpdk.org References: <1524842385-61707-1-git-send-email-xiangxia.m.yue@gmail.com> <1524842385-61707-2-git-send-email-xiangxia.m.yue@gmail.com> From: Maxime Coquelin Message-ID: <98a7f78c-d804-cbcb-7f4e-61b3f0c95297@redhat.com> Date: Fri, 4 May 2018 17:11:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1524842385-61707-2-git-send-email-xiangxia.m.yue@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 04 May 2018 15:11:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 04 May 2018 15:11:44 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH 2/3] vhost: fix crash and fd leak due to vhostuser destroyed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 May 2018 15:11:45 -0000 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