Message ID | 20190222024209.30879-1-tiwei.bie@intel.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 009AE2B9C; Fri, 22 Feb 2019 03:45:01 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id C12931D7 for <dev@dpdk.org>; Fri, 22 Feb 2019 03:44:58 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Feb 2019 18:44:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,397,1544515200"; d="scan'208";a="321102271" Received: from dpdk-tbie.sh.intel.com ([10.67.104.173]) by fmsmga006.fm.intel.com with ESMTP; 21 Feb 2019 18:44:56 -0800 From: Tiwei Bie <tiwei.bie@intel.com> To: maxime.coquelin@redhat.com, zhihong.wang@intel.com, dev@dpdk.org Date: Fri, 22 Feb 2019 10:42:05 +0800 Message-Id: <20190222024209.30879-1-tiwei.bie@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH 0/4] Some fixes for vhost zero copy X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series | Some fixes for vhost zero copy | |
Message
Tiwei Bie
Feb. 22, 2019, 2:42 a.m. UTC
Tiwei Bie (4): vhost: restore mbuf first when freeing zmbuf vhost: fix potential use-after-free for zero copy mbuf vhost: fix potential use-after-free for memory region doc: improve vhost zero copy guide doc/guides/prog_guide/vhost_lib.rst | 3 +++ lib/librte_vhost/vhost.h | 34 +++++++++++++++++++++++ lib/librte_vhost/vhost_user.c | 42 ++++++++++++++++++++++------- lib/librte_vhost/virtio_net.c | 34 ----------------------- 4 files changed, 70 insertions(+), 43 deletions(-)
Comments
On 2/22/19 3:42 AM, Tiwei Bie wrote: > Tiwei Bie (4): > vhost: restore mbuf first when freeing zmbuf > vhost: fix potential use-after-free for zero copy mbuf > vhost: fix potential use-after-free for memory region > doc: improve vhost zero copy guide > > doc/guides/prog_guide/vhost_lib.rst | 3 +++ > lib/librte_vhost/vhost.h | 34 +++++++++++++++++++++++ > lib/librte_vhost/vhost_user.c | 42 ++++++++++++++++++++++------- > lib/librte_vhost/virtio_net.c | 34 ----------------------- > 4 files changed, 70 insertions(+), 43 deletions(-) > Looking at the spec, I think we may need also to drain zmbufs in the VHOST_USER_SET_VRING_ENABLE for the disable case: "" If VHOST_USER_F_PROTOCOL_FEATURES has been negotiated, the ring is initialized in a disabled state. Client must not pass data to/from the backend until ring is enabled by VHOST_USER_SET_VRING_ENABLE with parameter 1, or after it has been disabled by VHOST_USER_SET_VRING_ENABLE with parameter 0. Each ring is initialized in a stopped state, client must not process it until ring is started, or *after it has been stopped*. "" Do you take care of this or I send a patch on top? Thanks, Maxime
On Tue, Feb 26, 2019 at 03:46:41PM +0100, Maxime Coquelin wrote: > On 2/22/19 3:42 AM, Tiwei Bie wrote: > > Tiwei Bie (4): > > vhost: restore mbuf first when freeing zmbuf > > vhost: fix potential use-after-free for zero copy mbuf > > vhost: fix potential use-after-free for memory region > > doc: improve vhost zero copy guide > > > > doc/guides/prog_guide/vhost_lib.rst | 3 +++ > > lib/librte_vhost/vhost.h | 34 +++++++++++++++++++++++ > > lib/librte_vhost/vhost_user.c | 42 ++++++++++++++++++++++------- > > lib/librte_vhost/virtio_net.c | 34 ----------------------- > > 4 files changed, 70 insertions(+), 43 deletions(-) > > > > Looking at the spec, I think we may need also to drain zmbufs in the > VHOST_USER_SET_VRING_ENABLE for the disable case: > > "" > If VHOST_USER_F_PROTOCOL_FEATURES has been negotiated, the ring is > initialized > in a disabled state. Client must not pass data to/from the backend until > ring is enabled by > VHOST_USER_SET_VRING_ENABLE with parameter 1, or after it has been disabled > by > VHOST_USER_SET_VRING_ENABLE with parameter 0. > > Each ring is initialized in a stopped state, client must not process it > until > ring is started, or *after it has been stopped*. > "" > > Do you take care of this or I send a patch on top? Agree. Please feel free to send any patch on top. Thanks! Tiwei > > Thanks, > Maxime
On 2/22/19 3:42 AM, Tiwei Bie wrote: > Tiwei Bie (4): > vhost: restore mbuf first when freeing zmbuf > vhost: fix potential use-after-free for zero copy mbuf > vhost: fix potential use-after-free for memory region > doc: improve vhost zero copy guide > > doc/guides/prog_guide/vhost_lib.rst | 3 +++ > lib/librte_vhost/vhost.h | 34 +++++++++++++++++++++++ > lib/librte_vhost/vhost_user.c | 42 ++++++++++++++++++++++------- > lib/librte_vhost/virtio_net.c | 34 ----------------------- > 4 files changed, 70 insertions(+), 43 deletions(-) > Applied to dpdk-next-virtio/master. Thanks, Maxime
On 2/27/19 2:52 AM, Tiwei Bie wrote: > On Tue, Feb 26, 2019 at 03:46:41PM +0100, Maxime Coquelin wrote: >> On 2/22/19 3:42 AM, Tiwei Bie wrote: >>> Tiwei Bie (4): >>> vhost: restore mbuf first when freeing zmbuf >>> vhost: fix potential use-after-free for zero copy mbuf >>> vhost: fix potential use-after-free for memory region >>> doc: improve vhost zero copy guide >>> >>> doc/guides/prog_guide/vhost_lib.rst | 3 +++ >>> lib/librte_vhost/vhost.h | 34 +++++++++++++++++++++++ >>> lib/librte_vhost/vhost_user.c | 42 ++++++++++++++++++++++------- >>> lib/librte_vhost/virtio_net.c | 34 ----------------------- >>> 4 files changed, 70 insertions(+), 43 deletions(-) >>> >> >> Looking at the spec, I think we may need also to drain zmbufs in the >> VHOST_USER_SET_VRING_ENABLE for the disable case: >> >> "" >> If VHOST_USER_F_PROTOCOL_FEATURES has been negotiated, the ring is >> initialized >> in a disabled state. Client must not pass data to/from the backend until >> ring is enabled by >> VHOST_USER_SET_VRING_ENABLE with parameter 1, or after it has been disabled >> by >> VHOST_USER_SET_VRING_ENABLE with parameter 0. >> >> Each ring is initialized in a stopped state, client must not process it >> until >> ring is started, or *after it has been stopped*. >> "" >> >> Do you take care of this or I send a patch on top? > > Agree. Please feel free to send any patch on top. Good, I'll do the patch now. Maxime > Thanks! > Tiwei > >> >> Thanks, >> Maxime