DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed
@ 2020-07-15 15:58 patrick.fu
  2020-07-16  8:23 ` Xiao, QimaiX
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: patrick.fu @ 2020-07-15 15:58 UTC (permalink / raw)
  To: dev, maxime.coquelin, chenbo.xia; +Cc: yinan.wang, Patrick Fu

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;
 }
 
 /*
-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed
  2020-07-15 15:58 [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed patrick.fu
@ 2020-07-16  8:23 ` Xiao, QimaiX
  2020-07-17  3:19 ` Xia, Chenbo
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Xiao, QimaiX @ 2020-07-16  8:23 UTC (permalink / raw)
  To: Fu, Patrick, dev, maxime.coquelin, Xia, Chenbo; +Cc: Wang, Yinan, Fu, Patrick

Tested-by: Xiao Qimai <qimaix.xiao@intel.com>

Regards,
Xiao Qimai

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of patrick.fu@intel.com
> Sent: Wednesday, July 15, 2020 11:59 PM
> To: dev@dpdk.org; maxime.coquelin@redhat.com; Xia, Chenbo
> <chenbo.xia@intel.com>
> Cc: Wang, Yinan <yinan.wang@intel.com>; Fu, Patrick <patrick.fu@intel.com>
> Subject: [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed
> 
> 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;
>  }
> 
>  /*
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed
  2020-07-15 15:58 [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed 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-21 12:10 ` [dpdk-dev] [PATCH v2] vhost: fix double-free with zero-copy patrick.fu
  3 siblings, 1 reply; 10+ messages in thread
From: Xia, Chenbo @ 2020-07-17  3:19 UTC (permalink / raw)
  To: Fu, Patrick, dev, maxime.coquelin; +Cc: Wang, Yinan


> -----Original Message-----
> From: Fu, Patrick <patrick.fu@intel.com>
> Sent: Wednesday, July 15, 2020 11:59 PM
> To: dev@dpdk.org; maxime.coquelin@redhat.com; Xia, Chenbo
> <chenbo.xia@intel.com>
> Cc: Wang, Yinan <yinan.wang@intel.com>; Fu, Patrick <patrick.fu@intel.com>
> Subject: [PATCH v1] vhost: set zmbufs to NULL when freed
> 
> 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;
>  }
> 
>  /*
> --
> 2.17.1

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed
  2020-07-17  3:19 ` Xia, Chenbo
@ 2020-07-17 12:35   ` Ferruh Yigit
  0 siblings, 0 replies; 10+ messages in thread
From: Ferruh Yigit @ 2020-07-17 12:35 UTC (permalink / raw)
  To: Xia, Chenbo, Fu, Patrick, dev, maxime.coquelin; +Cc: Wang, Yinan

On 7/17/2020 4:19 AM, Xia, Chenbo wrote:
> 
>> -----Original Message-----
>> From: Fu, Patrick <patrick.fu@intel.com>
>> Sent: Wednesday, July 15, 2020 11:59 PM
>> To: dev@dpdk.org; maxime.coquelin@redhat.com; Xia, Chenbo
>> <chenbo.xia@intel.com>
>> Cc: Wang, Yinan <yinan.wang@intel.com>; Fu, Patrick <patrick.fu@intel.com>
>> Subject: [PATCH v1] vhost: set zmbufs to NULL when freed
>>
>> 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;
>>  }
>>
>>  /*
>> --
>> 2.17.1
> 
> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
> 

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed
  2020-07-15 15:58 [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed patrick.fu
  2020-07-16  8:23 ` Xiao, QimaiX
  2020-07-17  3:19 ` Xia, Chenbo
@ 2020-07-20 15:51 ` Maxime Coquelin
  2020-07-20 16:49   ` Ferruh Yigit
  2020-07-21  3:18   ` Fu, Patrick
  2020-07-21 12:10 ` [dpdk-dev] [PATCH v2] vhost: fix double-free with zero-copy patrick.fu
  3 siblings, 2 replies; 10+ messages in thread
From: Maxime Coquelin @ 2020-07-20 15:51 UTC (permalink / raw)
  To: patrick.fu, dev, chenbo.xia; +Cc: yinan.wang

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;
>  }
>  
>  /*
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed
  2020-07-20 15:51 ` Maxime Coquelin
@ 2020-07-20 16:49   ` Ferruh Yigit
  2020-07-21  3:18   ` Fu, Patrick
  1 sibling, 0 replies; 10+ messages in thread
From: Ferruh Yigit @ 2020-07-20 16:49 UTC (permalink / raw)
  To: Maxime Coquelin, patrick.fu, dev, chenbo.xia; +Cc: yinan.wang

On 7/20/2020 4:51 PM, Maxime Coquelin wrote:
> Do you agree with below title?
> vhost: fix double-free with zero-copy

Existing commit dropped from next-net and patchwork status updated.

> 
> 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>

<...>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed
  2020-07-20 15:51 ` Maxime Coquelin
  2020-07-20 16:49   ` Ferruh Yigit
@ 2020-07-21  3:18   ` Fu, Patrick
  1 sibling, 0 replies; 10+ messages in thread
From: Fu, Patrick @ 2020-07-21  3:18 UTC (permalink / raw)
  To: Maxime Coquelin, dev, Xia, Chenbo; +Cc: Wang, Yinan

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;
> >  }
> >
> >  /*
> >


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH v2] vhost: fix double-free with zero-copy
  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
  0 siblings, 1 reply; 10+ messages in thread
From: Maxime Coquelin @ 2020-07-21  9:16 UTC (permalink / raw)
  To: patrick.fu, dev, chenbo.xia



On 7/21/20 2:10 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>
> ---
> v2:
>  - revise commit message title
> 
>  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;
>  }
>  
>  /*
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dpdk-dev] [PATCH v2] vhost: fix double-free with zero-copy
  2020-07-15 15:58 [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed patrick.fu
                   ` (2 preceding siblings ...)
  2020-07-20 15:51 ` Maxime Coquelin
@ 2020-07-21 12:10 ` patrick.fu
  2020-07-21  9:16   ` Maxime Coquelin
  3 siblings, 1 reply; 10+ messages in thread
From: patrick.fu @ 2020-07-21 12:10 UTC (permalink / raw)
  To: dev, maxime.coquelin, chenbo.xia; +Cc: Patrick Fu

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>
---
v2:
 - revise commit message title

 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;
 }
 
 /*
-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH v2] vhost: fix double-free with zero-copy
  2020-07-21  9:16   ` Maxime Coquelin
@ 2020-07-21 14:58     ` Ferruh Yigit
  0 siblings, 0 replies; 10+ messages in thread
From: Ferruh Yigit @ 2020-07-21 14:58 UTC (permalink / raw)
  To: Maxime Coquelin, patrick.fu, dev, chenbo.xia

On 7/21/2020 10:16 AM, Maxime Coquelin wrote:
> 
> 
> On 7/21/20 2:10 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>
> 
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> 

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-07-21 14:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-15 15:58 [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed 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
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

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).