patch 'hash: fix unaligned access for CRC' has been queued to stable release 24.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Mar 19 23:01:58 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.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 03/21/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/a4899573c4ff1bcf8c04b452d9114908f8277b75

Thanks.

Luca Boccassi

---
>From a4899573c4ff1bcf8c04b452d9114908f8277b75 Mon Sep 17 00:00:00 2001
From: Radu Nicolau <radu.nicolau at intel.com>
Date: Fri, 27 Feb 2026 13:59:32 +0000
Subject: [PATCH] hash: fix unaligned access for CRC

[ upstream commit 112c07c62a885c826d316d84d6e540fdc7860c41 ]

rte_hash_crc assumes input pointer address is 8 byte aligned
which may not be always the case.
This fix aligns the input pointer before proceeding to process it
in 8 byte chunks.

Bugzilla ID: 1892
Fixes: af75078fece3 ("first public release")

Signed-off-by: Radu Nicolau <radu.nicolau at intel.com>
Acked-by: Marat Khalili <marat.khalili at huawei.com>
Tested-by: Marat Khalili <marat.khalili at huawei.com>
---
 lib/hash/rte_hash_crc.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/hash/rte_hash_crc.h b/lib/hash/rte_hash_crc.h
index fa07c97685..f60f4598d8 100644
--- a/lib/hash/rte_hash_crc.h
+++ b/lib/hash/rte_hash_crc.h
@@ -127,6 +127,16 @@ rte_hash_crc(const void *data, uint32_t data_len, uint32_t init_val)
 	unsigned i;
 	uintptr_t pd = (uintptr_t) data;
 
+	/* align input to 8 byte boundary if needed */
+	if (pd & 0x7) {
+		unsigned int unaligned_bytes = RTE_MIN(8 - (pd & 0x7), data_len);
+		for (i = 0; i < unaligned_bytes; i++) {
+			init_val = rte_hash_crc_1byte(*(const uint8_t *)pd, init_val);
+			pd++;
+			data_len--;
+		}
+	}
+
 	for (i = 0; i < data_len / 8; i++) {
 		init_val = rte_hash_crc_8byte(*(const uint64_t *)pd, init_val);
 		pd += 8;
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-03-19 22:00:48.040175074 +0000
+++ 0006-hash-fix-unaligned-access-for-CRC.patch	2026-03-19 22:00:47.766359371 +0000
@@ -1 +1 @@
-From 112c07c62a885c826d316d84d6e540fdc7860c41 Mon Sep 17 00:00:00 2001
+From a4899573c4ff1bcf8c04b452d9114908f8277b75 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 112c07c62a885c826d316d84d6e540fdc7860c41 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list