patch 'net/bnxt: randomize flow table hash seed' has been queued to stable release 25.11.5

Kevin Traynor ktraynor at redhat.com
Thu Dec 3 14:05:11 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.11.5

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/08/26. 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/d6b2823542c344c11a7ce2bed78696393957f369

Thanks.

Kevin

---
>From d6b2823542c344c11a7ce2bed78696393957f369 Mon Sep 17 00:00:00 2001
From: Kishore Padmanabha <kishore.padmanabha at broadcom.com>
Date: Mon, 5 Oct 2026 15:25:19 -0500
Subject: [PATCH] net/bnxt: randomize flow table hash seed

[ upstream commit 234ddc75a732b1da66372e84da5f78e4585d63f6 ]

Seed the CRC32 hash used for TruFlow flow-offload table lookups
with a per-table random value instead of computing an unkeyed
CRC32 directly. An unkeyed hash lets an attacker who can influence
flow-key contents craft inputs that collide in the same bucket,
degrading flow insertion into worst-case behavior.

Fixes: b14da6540294 ("net/bnxt/tf_ulp: use optimized CRC32 hash")

Signed-off-by: Kishore Padmanabha <kishore.padmanabha at broadcom.com>
Signed-off-by: Manish Kurup <manish.kurup at broadcom.com>
---
 drivers/net/bnxt/tf_ulp/ulp_gen_hash.c | 22 +++++++++++++++-------
 drivers/net/bnxt/tf_ulp/ulp_gen_hash.h |  6 ++++++
 2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bnxt/tf_ulp/ulp_gen_hash.c b/drivers/net/bnxt/tf_ulp/ulp_gen_hash.c
index d94b59286f..e050a3a460 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_gen_hash.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_gen_hash.c
@@ -7,4 +7,5 @@
 #include <rte_log.h>
 #include <rte_malloc.h>
+#include <rte_random.h>
 #include <rte_hash_crc.h>
 
@@ -98,4 +99,10 @@ ulp_gen_hash_tbl_list_init(struct ulp_hash_create_params *cparams,
 	}
 	*hash_table = hash_tbl;
+
+	/* Random per-table seed so the CRC hash cannot be predicted offline
+	 * from attacker-controlled flow match fields.
+	 */
+	hash_tbl->hash_seed = (uint32_t)rte_rand();
+
 	/* allocate the memory for the hash key table */
 	hash_tbl->num_key_entries = cparams->num_key_entries;
@@ -204,29 +211,30 @@ ulp_gen_hash_tbl_list_key_search(struct ulp_gen_hash_tbl *hash_tbl,
 	}
 
-	/* calculate the hash */
+	/* calculate the hash, keyed with the table's random per-instance
+	 * seed so the bucket a key lands in cannot be predicted offline.
+	 */
 	switch (hash_tbl->key_tbl.data_size) {
 	case 1:
 		hash_id = rte_hash_crc_1byte(*entry->key_data,
-					     ~0U);
+					     hash_tbl->hash_seed);
 		break;
 	case 2:
 		hash_id = rte_hash_crc_2byte(*((uint16_t *)entry->key_data),
-					     ~0U);
+					     hash_tbl->hash_seed);
 		break;
 	case 4:
 		hash_id = rte_hash_crc_4byte(*((uint32_t *)entry->key_data),
-					     ~0U);
+					     hash_tbl->hash_seed);
 		break;
 	case 8:
 		hash_id = rte_hash_crc_8byte(*((uint64_t *)entry->key_data),
-					     ~0U);
+					     hash_tbl->hash_seed);
 		break;
 	default:
 		hash_id = rte_hash_crc(entry->key_data,
 				       hash_tbl->key_tbl.data_size,
-				       ~0U);
+				       hash_tbl->hash_seed);
 		break;
 	}
-	hash_id = (uint16_t)(((hash_id >> 16) & 0xffff) ^ (hash_id & 0xffff));
 	hash_id &= hash_tbl->hash_mask;
 	hash_id = hash_id * hash_tbl->hash_bkt_num;
diff --git a/drivers/net/bnxt/tf_ulp/ulp_gen_hash.h b/drivers/net/bnxt/tf_ulp/ulp_gen_hash.h
index d3f3840cbe..3aabea07ac 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_gen_hash.h
+++ b/drivers/net/bnxt/tf_ulp/ulp_gen_hash.h
@@ -58,4 +58,10 @@ struct ulp_gen_hash_tbl {
 	struct ulp_hash_bucket_entry	*hash_list;
 	uint32_t			hash_mask;
+	/* Per-table random seed for the CRC hash, set at init time so the
+	 * bucket a given key lands in cannot be predicted/targeted offline
+	 * by an attacker who controls flow match fields (hash-flooding
+	 * mitigation).
+	 */
+	uint32_t			hash_seed;
 
 	/* Bit allocator - to allocate key_res index */
-- 
2.56.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-12-03 12:52:50.084483484 +0000
+++ 0385-net-bnxt-randomize-flow-table-hash-seed.patch	2026-12-03 12:52:39.296938787 +0000
@@ -1 +1 @@
-From 234ddc75a732b1da66372e84da5f78e4585d63f6 Mon Sep 17 00:00:00 2001
+From d6b2823542c344c11a7ce2bed78696393957f369 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 234ddc75a732b1da66372e84da5f78e4585d63f6 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list