[dpdk-stable] patch 'net/af_packet: fix munmap on init failure' has been queued to LTS release 18.11.10

Kevin Traynor ktraynor at redhat.com
Fri Aug 28 12:12:30 CEST 2020


Hi,

FYI, your patch has been queued to LTS release 18.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 09/02/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/dba9120a2e05e60ae0e5ec23cb532eb3effcaaea

Thanks.

Kevin.

---
>From dba9120a2e05e60ae0e5ec23cb532eb3effcaaea Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian at huawei.com>
Date: Mon, 6 Jul 2020 20:28:02 +0800
Subject: [PATCH] net/af_packet: fix munmap on init failure

[ upstream commit b02e1742ebb5a6c23bea05c4d66b1d380bcd00eb ]

Add a missing available check and fix the wrong address passed
to munmap on init failure.

Fixes: dd6590fe2fd7 ("af_packet: fix possible memory leak")

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 drivers/net/af_packet/rte_eth_af_packet.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index bcbffe4caa..5eb71c9f5e 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -793,6 +793,7 @@ error:
 		close(qsockfd);
 	for (q = 0; q < nb_queues; q++) {
-		munmap((*internals)->rx_queue[q].map,
-		       2 * req->tp_block_size * req->tp_block_nr);
+		if ((*internals)->rx_queue[q].map != MAP_FAILED)
+			munmap((*internals)->rx_queue[q].map,
+			       2 * req->tp_block_size * req->tp_block_nr);
 
 		rte_free((*internals)->rx_queue[q].rd);
-- 
2.26.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-08-28 11:03:26.073025998 +0100
+++ 0004-net-af_packet-fix-munmap-on-init-failure.patch	2020-08-28 11:03:25.896955253 +0100
@@ -1 +1 @@
-From b02e1742ebb5a6c23bea05c4d66b1d380bcd00eb Mon Sep 17 00:00:00 2001
+From dba9120a2e05e60ae0e5ec23cb532eb3effcaaea Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b02e1742ebb5a6c23bea05c4d66b1d380bcd00eb ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
-index 62945fee20..b9723e9619 100644
+index bcbffe4caa..5eb71c9f5e 100644
@@ -22 +23 @@
-@@ -844,6 +844,7 @@ error:
+@@ -793,6 +793,7 @@ error:



More information about the stable mailing list