DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Fu, Patrick" <patrick.fu@intel.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"Xia, Chenbo" <chenbo.xia@intel.com>
Cc: "Wang, Yinan" <yinan.wang@intel.com>
Subject: Re: [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed
Date: Tue, 21 Jul 2020 03:18:56 +0000	[thread overview]
Message-ID: <MN2PR11MB3744FFE95F133625B966AADD84780@MN2PR11MB3744.namprd11.prod.outlook.com> (raw)
In-Reply-To: <75dbcd56-26e8-93e9-d65a-1377d32b9ffe@redhat.com>

V2 patch sent with revised title

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Monday, July 20, 2020 11:52 PM
> To: Fu, Patrick <patrick.fu@intel.com>; dev@dpdk.org; Xia, Chenbo
> <chenbo.xia@intel.com>
> Cc: Wang, Yinan <yinan.wang@intel.com>
> Subject: Re: [PATCH v1] vhost: set zmbufs to NULL when freed
> 
> Do you agree with below title?
> vhost: fix double-free with zero-copy
> 
> Thanks,
> Maxime
> 
> On 7/15/20 5:58 PM, patrick.fu@intel.com wrote:
> > From: Patrick Fu <patrick.fu@intel.com>
> >
> > zmbufs should be set to NULL when getting freed to avoid double free
> > on the same buffer pointer
> >
> > Fixes: b0a985d1f340 ("vhost: add dequeue zero copy")
> >
> > Signed-off-by: Patrick Fu <patrick.fu@intel.com>
> > ---
> >  lib/librte_vhost/vhost_user.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/lib/librte_vhost/vhost_user.c
> > b/lib/librte_vhost/vhost_user.c index df0db8a07..9ddeae362 100644
> > --- a/lib/librte_vhost/vhost_user.c
> > +++ b/lib/librte_vhost/vhost_user.c
> > @@ -1934,6 +1934,7 @@ free_zmbufs(struct vhost_virtqueue *vq)
> >  	drain_zmbuf_list(vq);
> >
> >  	rte_free(vq->zmbufs);
> > +	vq->zmbufs = NULL;
> >  }
> >
> >  /*
> >


  parent reply	other threads:[~2020-07-21  3:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 15:58 patrick.fu
2020-07-16  8:23 ` Xiao, QimaiX
2020-07-17  3:19 ` Xia, Chenbo
2020-07-17 12:35   ` Ferruh Yigit
2020-07-20 15:51 ` Maxime Coquelin
2020-07-20 16:49   ` Ferruh Yigit
2020-07-21  3:18   ` Fu, Patrick [this message]
2020-07-21 12:10 ` [dpdk-dev] [PATCH v2] vhost: fix double-free with zero-copy patrick.fu
2020-07-21  9:16   ` Maxime Coquelin
2020-07-21 14:58     ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN2PR11MB3744FFE95F133625B966AADD84780@MN2PR11MB3744.namprd11.prod.outlook.com \
    --to=patrick.fu@intel.com \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=yinan.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).