* [dpdk-dev] [PATCH] net/virtio: fix dangling pointer on failure
@ 2019-04-15 14:48 Aaron Conole
2019-04-15 14:48 ` Aaron Conole
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Aaron Conole @ 2019-04-15 14:48 UTC (permalink / raw)
To: dev; +Cc: stable, Maxime Coquelin, Tiwei Bie, Zhihong Wang, Pengzhen Liu
When eth_virtio_dev_init() is cleaning up, it does not correctly set
the mac_addrs variable to NULL, which will lead to a double free.
Found during unit-test fixes.
Fixes: 43d18765c027 ("net/virtio: fix memory leak on failure")
Cc: stable@dpdk.org
Reported-by: Michael Santana <msantana@redhat.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
---
drivers/net/virtio/virtio_ethdev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 2272bb2e5..d25c08f0a 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1862,6 +1862,7 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
out:
rte_free(eth_dev->data->mac_addrs);
+ eth_dev->data->mac_addrs = NULL;
return ret;
}
--
2.19.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH] net/virtio: fix dangling pointer on failure
2019-04-15 14:48 [dpdk-dev] [PATCH] net/virtio: fix dangling pointer on failure Aaron Conole
@ 2019-04-15 14:48 ` Aaron Conole
2019-04-16 5:19 ` Tiwei Bie
2019-04-17 7:52 ` Maxime Coquelin
2 siblings, 0 replies; 6+ messages in thread
From: Aaron Conole @ 2019-04-15 14:48 UTC (permalink / raw)
To: dev; +Cc: stable, Maxime Coquelin, Tiwei Bie, Zhihong Wang, Pengzhen Liu
When eth_virtio_dev_init() is cleaning up, it does not correctly set
the mac_addrs variable to NULL, which will lead to a double free.
Found during unit-test fixes.
Fixes: 43d18765c027 ("net/virtio: fix memory leak on failure")
Cc: stable@dpdk.org
Reported-by: Michael Santana <msantana@redhat.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
---
drivers/net/virtio/virtio_ethdev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 2272bb2e5..d25c08f0a 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1862,6 +1862,7 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
out:
rte_free(eth_dev->data->mac_addrs);
+ eth_dev->data->mac_addrs = NULL;
return ret;
}
--
2.19.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] net/virtio: fix dangling pointer on failure
2019-04-15 14:48 [dpdk-dev] [PATCH] net/virtio: fix dangling pointer on failure Aaron Conole
2019-04-15 14:48 ` Aaron Conole
@ 2019-04-16 5:19 ` Tiwei Bie
2019-04-16 5:19 ` Tiwei Bie
2019-04-17 7:52 ` Maxime Coquelin
2 siblings, 1 reply; 6+ messages in thread
From: Tiwei Bie @ 2019-04-16 5:19 UTC (permalink / raw)
To: Aaron Conole; +Cc: dev, stable, Maxime Coquelin, Zhihong Wang, Pengzhen Liu
On Mon, Apr 15, 2019 at 10:48:18AM -0400, Aaron Conole wrote:
> When eth_virtio_dev_init() is cleaning up, it does not correctly set
> the mac_addrs variable to NULL, which will lead to a double free.
>
> Found during unit-test fixes.
>
> Fixes: 43d18765c027 ("net/virtio: fix memory leak on failure")
> Cc: stable@dpdk.org
> Reported-by: Michael Santana <msantana@redhat.com>
> Signed-off-by: Aaron Conole <aconole@redhat.com>
> ---
> drivers/net/virtio/virtio_ethdev.c | 1 +
> 1 file changed, 1 insertion(+)
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] net/virtio: fix dangling pointer on failure
2019-04-16 5:19 ` Tiwei Bie
@ 2019-04-16 5:19 ` Tiwei Bie
0 siblings, 0 replies; 6+ messages in thread
From: Tiwei Bie @ 2019-04-16 5:19 UTC (permalink / raw)
To: Aaron Conole; +Cc: dev, stable, Maxime Coquelin, Zhihong Wang, Pengzhen Liu
On Mon, Apr 15, 2019 at 10:48:18AM -0400, Aaron Conole wrote:
> When eth_virtio_dev_init() is cleaning up, it does not correctly set
> the mac_addrs variable to NULL, which will lead to a double free.
>
> Found during unit-test fixes.
>
> Fixes: 43d18765c027 ("net/virtio: fix memory leak on failure")
> Cc: stable@dpdk.org
> Reported-by: Michael Santana <msantana@redhat.com>
> Signed-off-by: Aaron Conole <aconole@redhat.com>
> ---
> drivers/net/virtio/virtio_ethdev.c | 1 +
> 1 file changed, 1 insertion(+)
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] net/virtio: fix dangling pointer on failure
2019-04-15 14:48 [dpdk-dev] [PATCH] net/virtio: fix dangling pointer on failure Aaron Conole
2019-04-15 14:48 ` Aaron Conole
2019-04-16 5:19 ` Tiwei Bie
@ 2019-04-17 7:52 ` Maxime Coquelin
2019-04-17 7:52 ` Maxime Coquelin
2 siblings, 1 reply; 6+ messages in thread
From: Maxime Coquelin @ 2019-04-17 7:52 UTC (permalink / raw)
To: Aaron Conole, dev; +Cc: stable, Tiwei Bie, Zhihong Wang, Pengzhen Liu
On 4/15/19 4:48 PM, Aaron Conole wrote:
> When eth_virtio_dev_init() is cleaning up, it does not correctly set
> the mac_addrs variable to NULL, which will lead to a double free.
>
> Found during unit-test fixes.
>
> Fixes: 43d18765c027 ("net/virtio: fix memory leak on failure")
> Cc: stable@dpdk.org
> Reported-by: Michael Santana <msantana@redhat.com>
> Signed-off-by: Aaron Conole <aconole@redhat.com>
> ---
> drivers/net/virtio/virtio_ethdev.c | 1 +
> 1 file changed, 1 insertion(+)
Applied to dpdk-next-virtio/master.
Thanks,
Maxime
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] net/virtio: fix dangling pointer on failure
2019-04-17 7:52 ` Maxime Coquelin
@ 2019-04-17 7:52 ` Maxime Coquelin
0 siblings, 0 replies; 6+ messages in thread
From: Maxime Coquelin @ 2019-04-17 7:52 UTC (permalink / raw)
To: Aaron Conole, dev; +Cc: stable, Tiwei Bie, Zhihong Wang, Pengzhen Liu
On 4/15/19 4:48 PM, Aaron Conole wrote:
> When eth_virtio_dev_init() is cleaning up, it does not correctly set
> the mac_addrs variable to NULL, which will lead to a double free.
>
> Found during unit-test fixes.
>
> Fixes: 43d18765c027 ("net/virtio: fix memory leak on failure")
> Cc: stable@dpdk.org
> Reported-by: Michael Santana <msantana@redhat.com>
> Signed-off-by: Aaron Conole <aconole@redhat.com>
> ---
> drivers/net/virtio/virtio_ethdev.c | 1 +
> 1 file changed, 1 insertion(+)
Applied to dpdk-next-virtio/master.
Thanks,
Maxime
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-04-17 7:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-15 14:48 [dpdk-dev] [PATCH] net/virtio: fix dangling pointer on failure Aaron Conole
2019-04-15 14:48 ` Aaron Conole
2019-04-16 5:19 ` Tiwei Bie
2019-04-16 5:19 ` Tiwei Bie
2019-04-17 7:52 ` Maxime Coquelin
2019-04-17 7:52 ` Maxime Coquelin
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).