From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) by dpdk.org (Postfix) with ESMTP id 7EA3B5961 for ; Mon, 19 Oct 2015 11:44:55 +0200 (CEST) Received: by lfaz124 with SMTP id z124so105696566lfa.1 for ; Mon, 19 Oct 2015 02:44:55 -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; bh=obdwqFbhqosBo+k9cNVhpTagnw9m+tZLnBADSlcbBpI=; b=T704i+fPWAUxcYIP4LfhsOvufP6Ggm0+4TRR0iy29/HBzeLB/65vuz5Z5p3wL+yRw8 CDWfCDA5pbzDCY+bgHJ1P0TCgToJs/ZvrLxdvd/bc7jsEAKp90FloYc3A86dLgTohG9G JHu9o3tT4yjMP3Uez5RwYTQKS/vUNYM4gGg9LAPC/82vjgfpZyeQ2R38fcYvzVt6yGZK 7jOqHMfGh9pgunBzsDXyy/l1lxgwXWgL83oDjwi/6NSBabf7ButBMgYMsccencnp1k1p aOWGjDoCKF3v77LJ9J7SeWZgpB5di840enfwWU+QYIO/a7KS8y8/Npdyh4OTj8HM8Ktn OM4A== X-Gm-Message-State: ALoCoQkpmV4I1Fj20jeRiiMx9CXN+4gUTWPiSdXQi/XNl/CFfvLcWSoVJLxvsbiIV9F1zYuLq5cU X-Received: by 10.180.186.74 with SMTP id fi10mr18642829wic.61.1445247895193; Mon, 19 Oct 2015 02:44:55 -0700 (PDT) Received: from localhost.localdomain (ows-185-21-195-233.eu-west-1.compute.outscale.com. [185.21.195.233]) by smtp.gmail.com with ESMTPSA id xt1sm39011197wjb.32.2015.10.19.02.44.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Oct 2015 02:44:54 -0700 (PDT) From: Jerome Jutteau To: dev@dpdk.org Date: Mon, 19 Oct 2015 11:44:25 +0200 Message-Id: <1445247869-713-1-git-send-email-jerome.jutteau@outscale.com> X-Mailer: git-send-email 1.8.3.1 Subject: [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: Mon, 19 Oct 2015 09:44:55 -0000 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