From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id E857591A9 for ; Tue, 20 Oct 2015 10:25:46 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 20 Oct 2015 01:25:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,706,1437462000"; d="scan'208";a="815041420" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by fmsmga001.fm.intel.com with ESMTP; 20 Oct 2015 01:25:44 -0700 Date: Tue, 20 Oct 2015 16:25:50 +0800 From: Yuanhan Liu To: Jerome Jutteau Message-ID: <20151020082550.GY3115@yliu-dev.sh.intel.com> References: <1445247869-713-1-git-send-email-jerome.jutteau@outscale.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1445247869-713-1-git-send-email-jerome.jutteau@outscale.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2 0/4] vhost: Fix virtio-net on VHOST_USER_RESET_OWNER X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2015 08:25:47 -0000 Acked-by: Yuanhan Liu Thanks. --yliu On Mon, Oct 19, 2015 at 11:44:25AM +0200, Jerome Jutteau wrote: > Hi, > > I have a bug when Qemu with two vhost interfaces gently stops (SIGINT). > When stopping, it sends two RESET_OWNER for each interface: > - Before stopping, we have two interfaces identifers: 0 and 1. > - The first reset_owner call resets device 1 (and this id device_fh) to zero, > the device list now contains two devices with id 0. > - The second call don't find device 1 and segfault as reset_owner don't > check if the device has been found or not. > - Later, user_get_vring_base can also segfault for the same reason. > > This series of patches propose to fix the way reset_owner alter a device and > add more checks when searching for a device. > > In this v2, we use get_device instead of get_config_ll_entry to get an error > message when a device is not found. > > Jerome Jutteau (4): > vhost: avoid device identifier to be reset to 0 in reset_owner > vhost: check that a device exists during reset_owner > vhost: protect user_get_vring_base from unknown devices > vhost: change method to get device in reset_owner > > lib/librte_vhost/vhost_user/virtio-net-user.c | 2 ++ > lib/librte_vhost/virtio-net.c | 14 +++++++++----- > 2 files changed, 11 insertions(+), 5 deletions(-) > > -- > jerome