From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by dpdk.org (Postfix) with ESMTP id D57875A64 for ; Fri, 16 Oct 2015 11:09:09 +0200 (CEST) Received: by wicgb1 with SMTP id gb1so570229wic.1 for ; Fri, 16 Oct 2015 02:09:09 -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=lZRSU9M3C+/TyzJRs65CMyZnTlKk6jygVd30Wa3nf8o=; b=Cir/S4fcrpdTlTgprNPu/0imeuMOvsQqrVwLGWpD6TdmZGLIwtmlhiePxwt0BmtXm9 YbMLNYvBb+cmqw6oHDhTGpawZ+IUDQGf/EpWcgcNk/f50QmFaR3mPOeYO7kGI6npH5E0 wxbsGYCWKbjJRhTx+Drut4d1cfGueTyk5TL2/jgytp+HTTRnNtOgqi0cVN8F8fBmkji9 ykuSMW4ffSyqTuZgg+ZWSHAmCIzcHKW4zLgk3Ret/Eoq83ZXAFxn903Jx3VjAsI6FrhP QJvOSpzSoUu8RWMP92T93dh3TVNfnoarrckU096DxAzuhhxi4bMm+KygH0PIyzMevyBX V2+w== X-Gm-Message-State: ALoCoQn0OEw4liICjtPO8RMI9f0IE4V3/CuCyxo2Yu8MBuIy6RubE/G7I1e2/hihLr+tcNWYvnnS X-Received: by 10.180.86.39 with SMTP id m7mr3295899wiz.91.1444986549428; Fri, 16 Oct 2015 02:09:09 -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 ft2sm2409818wic.24.2015.10.16.02.09.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Oct 2015 02:09:08 -0700 (PDT) From: Jerome Jutteau To: dev@dpdk.org Date: Fri, 16 Oct 2015 11:08:47 +0200 Message-Id: <1444986530-20893-1-git-send-email-jerome.jutteau@outscale.com> X-Mailer: git-send-email 1.8.3.1 Cc: changchun.ouyang@intel.com Subject: [dpdk-dev] [PATCH 0/3] 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: Fri, 16 Oct 2015 09:09:10 -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. Jerome Jutteau (3): 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 lib/librte_vhost/vhost_user/virtio-net-user.c | 2 ++ lib/librte_vhost/virtio-net.c | 5 +++++ 2 files changed, 7 insertions(+) -- jerome