[dpdk-stable] patch 'net/sfc: fix buffer size for flow parse' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Mon May 10 17:59:26 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.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 05/12/21. 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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/32ae43ccb7f2fb0717cff7e741aadc9e2a9725ad

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 32ae43ccb7f2fb0717cff7e741aadc9e2a9725ad Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov at oktetlabs.ru>
Date: Fri, 26 Feb 2021 17:10:23 +0300
Subject: [PATCH] net/sfc: fix buffer size for flow parse
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit 05cc6e33961b41df6cdc37fd429e06c28c78a84e ]

Pass the size of the buffer where the item's mask
is stored and not the indirection pointer size.

Coverity issue: 363735
Fixes: dadff137931c ("net/sfc: support encap flow items in transfer rules")

Signed-off-by: Ivan Malov <ivan.malov at oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton at xilinx.com>
---
 drivers/net/sfc/sfc_mae.c | 20 +++++++++-----------
 drivers/net/sfc/sfc_mae.h |  3 ++-
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index 4ddfef5563..15c5c39758 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -1395,7 +1395,6 @@ sfc_mae_rule_parse_item_tunnel(const struct rte_flow_item *item,
 	uint8_t supp_mask[sizeof(uint64_t)];
 	const uint8_t *spec = NULL;
 	const uint8_t *mask = NULL;
-	const void *def_mask;
 	int rc;
 
 	/*
@@ -1417,12 +1416,11 @@ sfc_mae_rule_parse_item_tunnel(const struct rte_flow_item *item,
 	 * sfc_mae_rule_encap_parse_init(). Default mask
 	 * was also picked by that helper. Use it here.
 	 */
-	def_mask = ctx_mae->tunnel_def_mask;
-
 	rc = sfc_flow_parse_init(item,
 				 (const void **)&spec, (const void **)&mask,
-				 (const void *)&supp_mask, def_mask,
-				 sizeof(def_mask), error);
+				 (const void *)&supp_mask,
+				 ctx_mae->tunnel_def_mask,
+				 ctx_mae->tunnel_def_mask_size,  error);
 	if (rc != 0)
 		return rc;
 
@@ -1656,20 +1654,20 @@ sfc_mae_rule_encap_parse_init(struct sfc_adapter *sa,
 		case RTE_FLOW_ITEM_TYPE_VXLAN:
 			ctx->encap_type = EFX_TUNNEL_PROTOCOL_VXLAN;
 			ctx->tunnel_def_mask = &rte_flow_item_vxlan_mask;
-			RTE_BUILD_BUG_ON(sizeof(ctx->tunnel_def_mask) !=
-					 sizeof(rte_flow_item_vxlan_mask));
+			ctx->tunnel_def_mask_size =
+				sizeof(rte_flow_item_vxlan_mask);
 			break;
 		case RTE_FLOW_ITEM_TYPE_GENEVE:
 			ctx->encap_type = EFX_TUNNEL_PROTOCOL_GENEVE;
 			ctx->tunnel_def_mask = &rte_flow_item_geneve_mask;
-			RTE_BUILD_BUG_ON(sizeof(ctx->tunnel_def_mask) !=
-					 sizeof(rte_flow_item_geneve_mask));
+			ctx->tunnel_def_mask_size =
+				sizeof(rte_flow_item_geneve_mask);
 			break;
 		case RTE_FLOW_ITEM_TYPE_NVGRE:
 			ctx->encap_type = EFX_TUNNEL_PROTOCOL_NVGRE;
 			ctx->tunnel_def_mask = &rte_flow_item_nvgre_mask;
-			RTE_BUILD_BUG_ON(sizeof(ctx->tunnel_def_mask) !=
-					 sizeof(rte_flow_item_nvgre_mask));
+			ctx->tunnel_def_mask_size =
+				sizeof(rte_flow_item_nvgre_mask);
 			break;
 		case RTE_FLOW_ITEM_TYPE_END:
 			break;
diff --git a/drivers/net/sfc/sfc_mae.h b/drivers/net/sfc/sfc_mae.h
index 53ddead979..bf432638c1 100644
--- a/drivers/net/sfc/sfc_mae.h
+++ b/drivers/net/sfc/sfc_mae.h
@@ -179,7 +179,8 @@ struct sfc_mae_parse_ctx {
 	 * which part of the pattern is being parsed.
 	 */
 	const efx_mae_field_id_t	*field_ids_remap;
-	/* This points to a tunnel-specific default mask. */
+	/* These two fields correspond to the tunnel-specific default mask. */
+	size_t				tunnel_def_mask_size;
 	const void			*tunnel_def_mask;
 	bool				match_mport_set;
 	struct sfc_mae_pattern_data	pattern_data;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-10 23:59:27.163305100 +0800
+++ 0018-net-sfc-fix-buffer-size-for-flow-parse.patch	2021-05-10 23:59:26.340000000 +0800
@@ -1 +1 @@
-From 05cc6e33961b41df6cdc37fd429e06c28c78a84e Mon Sep 17 00:00:00 2001
+From 32ae43ccb7f2fb0717cff7e741aadc9e2a9725ad Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit 05cc6e33961b41df6cdc37fd429e06c28c78a84e ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list