patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 2/4] net/netvsc: fix invalid rte_free on dev_close
       [not found] <20200427232822.21695-1-stephen@networkplumber.org>
@ 2020-04-27 23:28 ` Stephen Hemminger
  0 siblings, 0 replies; only message in thread
From: Stephen Hemminger @ 2020-04-27 23:28 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, stable

The netvsc PMD is putting the mac address in private data.
Unless dev->data->mac_addrs is NULL'd rte_ethdev_close will
try and free the address array.
Causing the following scary error.
 EAL: Invalid memory

This is a simpler alternative to the fix already merged in 20.05-rc1

Fixes: f8279f47dd89 ("net/netvsc: fix crash in secondary process")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/netvsc/hn_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index 05f1a25a1abc..96480f930a46 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -849,6 +849,9 @@ hn_dev_close(struct rte_eth_dev *dev)
 
 	hn_vf_close(dev);
 	hn_dev_free_queues(dev);
+
+	/* mac_addrs must not be freed alone because part of dev_private */
+	dev->data->mac_addrs = NULL;
 }
 
 static const struct eth_dev_ops hn_eth_dev_ops = {
-- 
2.20.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-27 23:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200427232822.21695-1-stephen@networkplumber.org>
2020-04-27 23:28 ` [dpdk-stable] [PATCH 2/4] net/netvsc: fix invalid rte_free on dev_close Stephen Hemminger

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