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

Xueming Li xuemingl at nvidia.com
Mon Nov 11 07:27:38 CET 2024


Hi,

FYI, your patch has been queued to stable release 23.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/30/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=c098add6c3bd7d23d304d79c1ce8c3e76368c622

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From c098add6c3bd7d23d304d79c1ce8c3e76368c622 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
Cc: Xueming Li <xuemingl at nvidia.com>

[ 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 c739e92304..07c324743b 100644
--- a/lib/fib/dir24_8.c
+++ b/lib/fib/dir24_8.c
@@ -526,8 +526,8 @@ 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;
 		return NULL;
diff --git a/lib/fib/trie.c b/lib/fib/trie.c
index 7b33cdaa7b..ca1c2fe3bc 100644
--- a/lib/fib/trie.c
+++ b/lib/fib/trie.c
@@ -647,8 +647,8 @@ 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;
 		return dp;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-11-11 14:23:07.607431989 +0800
+++ 0052-fib-fix-AVX512-lookup.patch	2024-11-11 14:23:05.122192840 +0800
@@ -1 +1 @@
-From 66ed1786ad067198814e9b2ab54f0cad68a58f1e Mon Sep 17 00:00:00 2001
+From c098add6c3bd7d23d304d79c1ce8c3e76368c622 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 66ed1786ad067198814e9b2ab54f0cad68a58f1e ]
@@ -15 +17,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list