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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Nov 16 23:51:38 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.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 11/18/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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/974e734d1d4a97366c7972a6282994eb8ad2473e

Thanks.

Luca Boccassi

---
>From 974e734d1d4a97366c7972a6282994eb8ad2473e 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 05525c48be..2f406fdc54 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_gen_hash.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_gen_hash.c
@@ -6,6 +6,7 @@
 #include <rte_bitops.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
+#include <rte_random.h>
 #include <rte_hash_crc.h>
 
 #include "bnxt_tf_common.h"
@@ -97,6 +98,12 @@ ulp_gen_hash_tbl_list_init(struct ulp_hash_create_params *cparams,
 		return -ENOMEM;
 	}
 	*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;
 	hash_tbl->key_tbl.data_size = cparams->key_size;
@@ -203,31 +210,32 @@ ulp_gen_hash_tbl_list_key_search(struct ulp_gen_hash_tbl *hash_tbl,
 		return -EINVAL;
 	}
 
-	/* 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
@@ -57,6 +57,12 @@ struct ulp_gen_hash_tbl {
 	uint32_t			hash_bkt_num;
 	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 */
 	struct bit_alloc_list		bit_list;
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-11-16 22:52:17.482394746 +0000
+++ 0024-net-bnxt-randomize-flow-table-hash-seed.patch	2026-11-16 22:52:16.452232530 +0000
@@ -1 +1 @@
-From 234ddc75a732b1da66372e84da5f78e4585d63f6 Mon Sep 17 00:00:00 2001
+From 974e734d1d4a97366c7972a6282994eb8ad2473e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 234ddc75a732b1da66372e84da5f78e4585d63f6 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index d94b59286fc..e050a3a4608 100644
+index 05525c48be..2f406fdc54 100644
@@ -88 +89 @@
-index d3f3840cbe6..3aabea07ac3 100644
+index d3f3840cbe..3aabea07ac 100644


More information about the stable mailing list