vhost: set zmbufs to NULL when freed
PATCH 1/1 vhost: set zmbufs to NULL when freed
From: Patrick Fu <[email protected]>
zmbufs should be set to NULL when getting freed to avoid double free on the same buffer pointer
--- lib/librte_vhost/vhost_user.c | 1 + 1 file changed, 1 insertion(+)
lib/librte_vhost/vhost_user.c +1 -0
@@ -1934,6 +1934,7 @@ free_zmbufs(struct vhost_virtqueue *vq)drain_zmbuf_list (vq);rte_free (vq->zmbufs); + vq->zmbufs =NULL ; }/*
Signature · 1 line
2.17.1
Regards,
Xiao Qimai
Quoted 34 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of [email protected]
Sent: Wednesday, July 15, 2020 11:59 PM
To: [email protected]; [email protected]; Xia, Chenbo <[email protected]>
Cc: Wang, Yinan <[email protected]>; Fu, Patrick <[email protected]>
Subject: [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freedFrom: Patrick Fu <[email protected]>
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 <[email protected]>--- lib/librte_vhost/vhost_user.c | 1 + 1 file changed, 1 insertion(+)lib/librte_vhost/vhost_user.c +1
-1@@ -1934,6 +1934,7 @@ free_zmbufs(struct vhost_virtqueue *vq)drain_zmbuf_list (vq);rte_free (vq->zmbufs); + vq->zmbufs =NULL ; }/* -- 2.17.1
Quoted 34 lines
-----Original Message-----
From: Fu, Patrick <[email protected]>
Sent: Wednesday, July 15, 2020 11:59 PM
To: [email protected]; [email protected]; Xia, Chenbo <[email protected]>
Cc: Wang, Yinan <[email protected]>; Fu, Patrick <[email protected]>
Subject: [PATCH v1] vhost: set zmbufs to NULL when freedFrom: Patrick Fu <[email protected]>
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 <[email protected]>--- lib/librte_vhost/vhost_user.c | 1 + 1 file changed, 1 insertion(+)lib/librte_vhost/vhost_user.c index renamed from lib/librte_vhost/vhost_user.c +0
-0
df0db8a07..9ddeae362100644lib/librte_vhost/vhost_user.c +1
-1@@ -1934,6 +1934,7 @@ free_zmbufs(struct vhost_virtqueue *vq)drain_zmbuf_list (vq);rte_free (vq->zmbufs); + vq->zmbufs =NULL ; }/* --
Quoted 1 line
2.17.1
Ferruh Yigit
AppliedQuoted 32 lines · Chenbo
Quoted 32 lines
-----Original Message-----
From: Fu, Patrick <[email protected]>
Sent: Wednesday, July 15, 2020 11:59 PM
To: [email protected]; [email protected]; Xia, Chenbo <[email protected]>
Cc: Wang, Yinan <[email protected]>; Fu, Patrick <[email protected]>
Subject: [PATCH v1] vhost: set zmbufs to NULL when freedFrom: Patrick Fu <[email protected]>
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 <[email protected]>--- lib/librte_vhost/vhost_user.c | 1 + 1 file changed, 1 insertion(+)lib/librte_vhost/vhost_user.c index renamed from lib/librte_vhost/vhost_user.c +0
-0
df0db8a07..9ddeae362100644lib/librte_vhost/vhost_user.c +1
-0@@ -1934,6 +1934,7 @@ free_zmbufs(struct vhost_virtqueue *vq)drain_zmbuf_list (vq);rte_free (vq->zmbufs); + vq->zmbufs =NULL ; }
Quoted 6 lines
Quoted 3 lines
lib/librte_vhost/vhost_user.c +0
-1/* -- 2.17.1
Reviewed-by Chenbo Xia <[email protected]>
Applied to dpdk-next-net/master, thanks.
Do you agree with below title?
vhost: fix double-free with zero-copy
Thanks,
Maxime
Quoted 25 lines · On 7/15/20 5:58 PM, [email protected] wrote:
From: Patrick Fu <[email protected]>
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 <[email protected]>--- lib/librte_vhost/vhost_user.c | 1 + 1 file changed, 1 insertion(+)lib/librte_vhost/vhost_user.c +1
-0@@ -1934,6 +1934,7 @@ free_zmbufs(struct vhost_virtqueue *vq)drain_zmbuf_list (vq);rte_free (vq->zmbufs); + vq->zmbufs =NULL ; }/*
Quoted 2 lines · Maxime Coquelin
Do you agree with below title?
vhost: fix double-free with zero-copy
Existing commit dropped from next-net and patchwork status updated.
Quoted 13 lines
Thanks,
MaximeQuoted 8 lines · On 7/15/20 5:58 PM, [email protected] wrote:
From: Patrick Fu <[email protected]>
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 <[email protected]>
<...>
PATCH v2 1/1 vhost: fix double-free with zero-copy
In reply to [email protected]From: Patrick Fu <[email protected]>
zmbufs should be set to NULL when getting freed to avoid double free on the same buffer pointer
---
v2:
- revise commit message title
lib/librte_vhost/vhost_user.c | 1 + 1 file changed, 1 insertion(+)
lib/librte_vhost/vhost_user.c +1 -0
@@ -1934,6 +1934,7 @@ free_zmbufs(struct vhost_virtqueue *vq)drain_zmbuf_list (vq);rte_free (vq->zmbufs); + vq->zmbufs =NULL ; }/*
Signature · 1 line
2.17.1
V2 patch sent with revised title
Quoted 40 lines
-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Monday, July 20, 2020 11:52 PM
To: Fu, Patrick <[email protected]>; [email protected]; Xia, Chenbo <[email protected]>
Cc: Wang, Yinan <[email protected]>
Subject: Re: [PATCH v1] vhost: set zmbufs to NULL when freedDo you agree with below title?
vhost: fix double-free with zero-copyThanks,
MaximeQuoted 25 lines · On 7/15/20 5:58 PM, [email protected] wrote:
From: Patrick Fu <[email protected]>
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 <[email protected]>--- lib/librte_vhost/vhost_user.c | 1 + 1 file changed, 1 insertion(+)(quoted diff) +0
-0
b/lib/librte_vhost/vhost_user.cindexdf0db8a07..9ddeae362100644lib/librte_vhost/vhost_user.c +1
-0@@ -1934,6 +1934,7 @@ free_zmbufs(struct vhost_virtqueue *vq)drain_zmbuf_list (vq);rte_free (vq->zmbufs); + vq->zmbufs =NULL ; }/*
Re: [dpdk-dev] [PATCH v2] vhost: fix double-free with zero-copy
In reply to [email protected]Quoted 21 lines · On 7/21/20 2:10 PM, [email protected] wrote:
From: Patrick Fu <[email protected]>
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 <[email protected]>---
v2:
- revise commit message titlelib/librte_vhost/vhost_user.c | 1 + 1 file changed, 1 insertion(+)lib/librte_vhost/vhost_user.c +0
-0
lib/librte_vhost/vhost_user.c free_zmbufs(struct vhost_virtqueue *vq) · line 1940
Quoted 7 lines
lib/librte_vhost/vhost_user.c +1
-0@@ -1934,6 +1934,7 @@ free_zmbufs(struct vhost_virtqueue *vq)drain_zmbuf_list (vq);rte_free (vq->zmbufs); + vq->zmbufs =NULL ; }/*
Thanks,
Maxime
Ferruh Yigit
AppliedRe: [dpdk-dev] [PATCH v2] vhost: fix double-free with zero-copy
Quoted 5 lines · Maxime Coquelin
Quoted 2 lines · On 7/21/20 2:10 PM, [email protected] wrote:
From: Patrick Fu <[email protected]>
Quoted 9 lines
Quoted 6 lines
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 <[email protected]>Reviewed-by Maxime Coquelin <[email protected]>
Applied to dpdk-next-net/master, thanks.