patch 'net/ice: fix memory leaks in raw pattern parsing' has been queued to stable release 23.11.2
Xueming Li
xuemingl at nvidia.com
Mon Aug 12 14:49:52 CEST 2024
Hi,
FYI, your patch has been queued to stable release 23.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/14/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=17e800edd19dc5cb00acf53ffd8baef713954c9c
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 17e800edd19dc5cb00acf53ffd8baef713954c9c Mon Sep 17 00:00:00 2001
From: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
Date: Mon, 22 Jul 2024 13:50:44 +0000
Subject: [PATCH] net/ice: fix memory leaks in raw pattern parsing
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 8044e1d19db3d0012bd1348cb4fcf542d31cd41a ]
This patch fixes possible memory leaks inside the
ice_hash_parse_raw_pattern() due to the lack of a call to rte_free() for
previously allocated pkt_buf and msk_buf.
Fixes: 1b9c68120a1c ("net/ice: enable protocol agnostic flow offloading in RSS")
Reported-by: Michael Theodore Stolarchuk <mike.stolarchuk at arista.com>
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
.mailmap | 1 +
drivers/net/ice/ice_hash.c | 22 ++++++++++++++--------
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/.mailmap b/.mailmap
index 4a92c054fb..bea129355d 100644
--- a/.mailmap
+++ b/.mailmap
@@ -953,6 +953,7 @@ Michael Santana <maicolgabriel at hotmail.com> <msantana at redhat.com>
Michael Savisko <michaelsav at nvidia.com>
Michael Shamis <michaelsh at marvell.com>
Michael S. Tsirkin <mst at redhat.com>
+Michael Theodore Stolarchuk <mike.stolarchuk at arista.com>
Michael Wildt <michael.wildt at broadcom.com>
Michal Berger <michallinuxstuff at gmail.com>
Michal Jastrzebski <michalx.k.jastrzebski at intel.com>
diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index f923641533..6b3095e2c5 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -650,7 +650,7 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad,
uint8_t *pkt_buf, *msk_buf;
uint8_t tmp_val = 0;
uint8_t tmp_c = 0;
- int i, j;
+ int i, j, ret = 0;
if (ad->psr == NULL)
return -rte_errno;
@@ -670,8 +670,10 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad,
return -ENOMEM;
msk_buf = rte_zmalloc(NULL, pkt_len, 0);
- if (!msk_buf)
+ if (!msk_buf) {
+ rte_free(pkt_buf);
return -ENOMEM;
+ }
/* convert string to int array */
for (i = 0, j = 0; i < spec_len; i += 2, j++) {
@@ -708,18 +710,22 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad,
msk_buf[j] = tmp_val * 16 + tmp_c - '0';
}
- if (ice_parser_run(ad->psr, pkt_buf, pkt_len, &rslt))
- return -rte_errno;
+ ret = ice_parser_run(ad->psr, pkt_buf, pkt_len, &rslt);
+ if (ret)
+ goto free_mem;
- if (ice_parser_profile_init(&rslt, pkt_buf, msk_buf,
- pkt_len, ICE_BLK_RSS, true, &prof))
- return -rte_errno;
+ ret = ice_parser_profile_init(&rslt, pkt_buf, msk_buf,
+ pkt_len, ICE_BLK_RSS, true, &prof);
+ if (ret)
+ goto free_mem;
rte_memcpy(&meta->raw.prof, &prof, sizeof(prof));
+free_mem:
rte_free(pkt_buf);
rte_free(msk_buf);
- return 0;
+
+ return ret;
}
static void
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-08-12 20:44:06.156823909 +0800
+++ 0115-net-ice-fix-memory-leaks-in-raw-pattern-parsing.patch 2024-08-12 20:44:02.445069363 +0800
@@ -1 +1 @@
-From 8044e1d19db3d0012bd1348cb4fcf542d31cd41a Mon Sep 17 00:00:00 2001
+From 17e800edd19dc5cb00acf53ffd8baef713954c9c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 8044e1d19db3d0012bd1348cb4fcf542d31cd41a ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -22 +24 @@
-index a6088813cc..541ca895a4 100644
+index 4a92c054fb..bea129355d 100644
@@ -25 +27 @@
-@@ -978,6 +978,7 @@ Michael Santana <maicolgabriel at hotmail.com> <msantana at redhat.com>
+@@ -953,6 +953,7 @@ Michael Santana <maicolgabriel at hotmail.com> <msantana at redhat.com>
More information about the stable
mailing list