patch 'fib: fix AVX512 lookup' has been queued to stable release 21.11.9

Kevin Traynor ktraynor at redhat.com
Wed Nov 27 18:17:33 CET 2024


Hi,

FYI, your patch has been queued to stable release 21.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/02/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://github.com/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
>From e364af95ac7aec6843623702a6c2c4dd46c756cf Mon Sep 17 00:00:00 2001
From: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
Date: Fri, 6 Sep 2024 17:04:36 +0000
Subject: [PATCH] fib: fix AVX512 lookup

[ upstream commit 66ed1786ad067198814e9b2ab54f0cad68a58f1e ]

Vector lookup uses gather instructions which loads data in 4byte chunks.
This could lead to out of bounds access at the end of the tbl24 in case
of 1 or 2 byte entries if e.g. lookup is attempted for 255.255.255.255
in IPv4 case.
This patch fixes potential out of bound access by gather instruction
allocating an extra 4 byte in the end of the tbl24.

Fixes: b3509fa3653e ("fib: add AVX512 lookup")
Fixes: 1e5630e40d95 ("fib6: add AVX512 lookup")

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
---
 lib/fib/dir24_8.c | 4 ++--
 lib/fib/trie.c    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/fib/dir24_8.c b/lib/fib/dir24_8.c
index 49407ba638..ecd24dc258 100644
--- a/lib/fib/dir24_8.c
+++ b/lib/fib/dir24_8.c
@@ -531,6 +531,6 @@ dir24_8_create(const char *name, int socket_id, struct rte_fib_conf *fib_conf)
 	snprintf(mem_name, sizeof(mem_name), "DP_%s", name);
 	dp = rte_zmalloc_socket(name, sizeof(struct dir24_8_tbl) +
-		DIR24_8_TBL24_NUM_ENT * (1 << nh_sz), RTE_CACHE_LINE_SIZE,
-		socket_id);
+		DIR24_8_TBL24_NUM_ENT * (1 << nh_sz) + sizeof(uint32_t),
+		RTE_CACHE_LINE_SIZE, socket_id);
 	if (dp == NULL) {
 		rte_errno = ENOMEM;
diff --git a/lib/fib/trie.c b/lib/fib/trie.c
index e7ea4f2be2..f9f2dda517 100644
--- a/lib/fib/trie.c
+++ b/lib/fib/trie.c
@@ -653,6 +653,6 @@ trie_create(const char *name, int socket_id,
 	snprintf(mem_name, sizeof(mem_name), "DP_%s", name);
 	dp = rte_zmalloc_socket(name, sizeof(struct rte_trie_tbl) +
-		TRIE_TBL24_NUM_ENT * (1 << nh_sz), RTE_CACHE_LINE_SIZE,
-		socket_id);
+		TRIE_TBL24_NUM_ENT * (1 << nh_sz) + sizeof(uint32_t),
+		RTE_CACHE_LINE_SIZE, socket_id);
 	if (dp == NULL) {
 		rte_errno = ENOMEM;
-- 
2.47.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-11-27 17:17:39.122651295 +0000
+++ 0026-fib-fix-AVX512-lookup.patch	2024-11-27 17:17:38.181269145 +0000
@@ -1 +1 @@
-From 66ed1786ad067198814e9b2ab54f0cad68a58f1e Mon Sep 17 00:00:00 2001
+From e364af95ac7aec6843623702a6c2c4dd46c756cf Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 66ed1786ad067198814e9b2ab54f0cad68a58f1e ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -24 +25 @@
-index c739e92304..07c324743b 100644
+index 49407ba638..ecd24dc258 100644
@@ -27 +28 @@
-@@ -527,6 +527,6 @@ dir24_8_create(const char *name, int socket_id, struct rte_fib_conf *fib_conf)
+@@ -531,6 +531,6 @@ dir24_8_create(const char *name, int socket_id, struct rte_fib_conf *fib_conf)
@@ -37 +38 @@
-index 7b33cdaa7b..ca1c2fe3bc 100644
+index e7ea4f2be2..f9f2dda517 100644
@@ -40 +41 @@
-@@ -648,6 +648,6 @@ trie_create(const char *name, int socket_id,
+@@ -653,6 +653,6 @@ trie_create(const char *name, int socket_id,



More information about the stable mailing list