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>,
	Stephen Hemminger <sthemmin@microsoft.com>
Subject: [dpdk-dev] [PATCH v2 1/2] netvsc: fix rte malloc pool corruption
Date: Mon, 13 Aug 2018 08:51:07 -0700	[thread overview]
Message-ID: <20180813155108.6460-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20180813155108.6460-1-stephen@networkplumber.org>

The event buffer was changed to be a fixed size value, but
calls to rte_free were left. That causes bugs because
it calls to rte_free() for a pointer that was not setup with
rte_malloc().

Fixes: 530af95a7849 ("bus/vmbus: avoid signalling host on read")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 drivers/net/netvsc/hn_rxtx.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c
index 02ef27e363cc..3e52a328b152 100644
--- a/drivers/net/netvsc/hn_rxtx.c
+++ b/drivers/net/netvsc/hn_rxtx.c
@@ -776,7 +776,6 @@ hn_dev_rx_queue_setup(struct rte_eth_dev *dev,
 
 fail:
 	rte_ring_free(rxq->rx_ring);
-	rte_free(rxq->event_buf);
 	rte_free(rxq);
 	return -ENOMEM;
 }
@@ -795,10 +794,8 @@ hn_dev_rx_queue_release(void *arg)
 	rxq->rx_ring = NULL;
 	rxq->mb_pool = NULL;
 
-	if (rxq != rxq->hv->primary) {
-		rte_free(rxq->event_buf);
+	if (rxq != rxq->hv->primary)
 		rte_free(rxq);
-	}
 }
 
 void
-- 
2.18.0

  reply	other threads:[~2018-08-13 15:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-13 15:51 [dpdk-dev] [PATCH v2 0/2] netvsc: event buffer bug fixes Stephen Hemminger
2018-08-13 15:51 ` Stephen Hemminger [this message]
2018-08-13 15:51 ` [dpdk-dev] [PATCH v2 2/2] netvsc: resize event buffer as needed Stephen Hemminger
2018-08-13 17:22   ` 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=20180813155108.6460-2-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=sthemmin@microsoft.com \
    /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).