DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 2/4] net/netvsc: fix invalid rte_free on dev_close
Date: Mon, 27 Apr 2020 16:28:20 -0700	[thread overview]
Message-ID: <20200427232822.21695-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20200427232822.21695-1-stephen@networkplumber.org>

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


  parent reply	other threads:[~2020-04-27 23:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27 23:28 [dpdk-dev] [PATCH 0/4] net/netvsc: minor fixes Stephen Hemminger
2020-04-27 23:28 ` [dpdk-dev] [PATCH 1/4] net/vmbus: add missing barrier Stephen Hemminger
2020-04-29  2:31   ` Ruifeng Wang
2020-04-27 23:28 ` Stephen Hemminger [this message]
2020-04-27 23:28 ` [dpdk-dev] [PATCH 3/4] net/netvsc: fix comment spelling errors Stephen Hemminger
2020-04-27 23:28 ` [dpdk-dev] [PATCH 4/4] bus/vmbus: " Stephen Hemminger

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=20200427232822.21695-3-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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).