From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by dpdk.org (Postfix) with ESMTP id 4100293F8 for ; Wed, 21 Oct 2015 12:27:32 +0200 (CEST) Received: by wicfv8 with SMTP id fv8so67934726wic.0 for ; Wed, 21 Oct 2015 03:27:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=tVetYWOuBo3Sepi3RLZsqiKpCi83K0TO1WFhfnqdQtg=; b=B6UC+KCFl25FoU/g1bFM99RjUleeVK/Yqhkq4reDpBmetc/Un7tfvBkQWb1iex6m1q ew6NYPToCqBRAWd8BOQQ+jIf3SSsljdTVkyrdlaavrwRuFkRNlP/acLB7jfbm5FJKwQE uOjPOhdKo1FGKrHKAZAKY6ryDN6sWXm7WLRuq7En3Y3m331VXM8CQnDUbRy8kjRInFmm dUi+lpPnd1neOkeoLIadW4wfqmxneFaBnU415WCuVSbdG1JUqI1g8U64FOe30p5tXOUk H0UEIbGZCa8qUSVs7USnNl6+NCxmolgo+8GfDuBXvwnSOMAZLDplha/aSQVw3cjSZZse dwTA== X-Gm-Message-State: ALoCoQnpp7IbUZbFXjkYqeGsdb4741zMwvMjnQpPtReiXZYjKr7p8u6n6+ZZRdabSf13We0ZBhG2 X-Received: by 10.194.9.97 with SMTP id y1mr11389962wja.84.1445423251698; Wed, 21 Oct 2015 03:27:31 -0700 (PDT) Received: from xps13.localnet (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id uj4sm9468984wjc.34.2015.10.21.03.27.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Oct 2015 03:27:31 -0700 (PDT) From: Thomas Monjalon To: Jerome Jutteau Date: Wed, 21 Oct 2015 12:26:26 +0200 Message-ID: <2592854.UTMZLixLNt@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <20151020082550.GY3115@yliu-dev.sh.intel.com> References: <1445247869-713-1-git-send-email-jerome.jutteau@outscale.com> <20151020082550.GY3115@yliu-dev.sh.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: Wed, 21 Oct 2015 10:27:32 -0000 > > 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 > > Acked-by: Yuanhan Liu Applied, thanks