patch 'crypto/dpaa_sec: fix bitmask truncation' has been queued to stable release 23.11.4
Xueming Li
xuemingl at nvidia.com
Tue Feb 18 13:35:15 CET 2025
Hi,
FYI, your patch has been queued to stable release 23.11.4
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
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=2327043ff494d807aaaec57f42b2c5d78389c8a7
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 2327043ff494d807aaaec57f42b2c5d78389c8a7 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Wed, 5 Feb 2025 08:23:14 -0800
Subject: [PATCH] crypto/dpaa_sec: fix bitmask truncation
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 7c18f573c1f5368f70e6e956c4ba0c6f97b19cb1 ]
The dqrr_held mask is 64 bit but updates were getting truncated
because 1 is of type int (32 bit) and the result shift of int is of
type int (32 bit); therefore any value >= 32 would get truncated.
Link: https://pvs-studio.com/en/blog/posts/cpp/1183/
Fixes: fe3688ba7950 ("crypto/dpaa_sec: support event crypto adapter")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
drivers/crypto/dpaa_sec/dpaa_sec.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 131cd90c94..502e4fbed1 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -1903,13 +1903,12 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops,
op = *(ops++);
if (*dpaa_seqn(op->sym->m_src) != 0) {
index = *dpaa_seqn(op->sym->m_src) - 1;
- if (DPAA_PER_LCORE_DQRR_HELD & (1 << index)) {
+ if (DPAA_PER_LCORE_DQRR_HELD & (UINT64_C(1) << index)) {
/* QM_EQCR_DCA_IDXMASK = 0x0f */
flags[loop] = ((index & 0x0f) << 8);
flags[loop] |= QMAN_ENQUEUE_FLAG_DCA;
DPAA_PER_LCORE_DQRR_SIZE--;
- DPAA_PER_LCORE_DQRR_HELD &=
- ~(1 << index);
+ DPAA_PER_LCORE_DQRR_HELD &= ~(UINT64_C(1) << index);
}
}
@@ -3447,7 +3446,7 @@ dpaa_sec_process_atomic_event(void *event,
/* Save active dqrr entries */
index = ((uintptr_t)dqrr >> 6) & (16/*QM_DQRR_SIZE*/ - 1);
DPAA_PER_LCORE_DQRR_SIZE++;
- DPAA_PER_LCORE_DQRR_HELD |= 1 << index;
+ DPAA_PER_LCORE_DQRR_HELD |= UINT64_C(1) << index;
DPAA_PER_LCORE_DQRR_MBUF(index) = ctx->op->sym->m_src;
ev->impl_opaque = index + 1;
*dpaa_seqn(ctx->op->sym->m_src) = (uint32_t)index + 1;
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-02-18 19:39:03.484912756 +0800
+++ 0080-crypto-dpaa_sec-fix-bitmask-truncation.patch 2025-02-18 19:39:00.718244032 +0800
@@ -1 +1 @@
-From 7c18f573c1f5368f70e6e956c4ba0c6f97b19cb1 Mon Sep 17 00:00:00 2001
+From 2327043ff494d807aaaec57f42b2c5d78389c8a7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 7c18f573c1f5368f70e6e956c4ba0c6f97b19cb1 ]
@@ -13 +15,0 @@
-Cc: stable at dpdk.org
@@ -22 +24 @@
-index 3fa88ca968..e117cd77a6 100644
+index 131cd90c94..502e4fbed1 100644
@@ -25 +27 @@
-@@ -1907,13 +1907,12 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops,
+@@ -1903,13 +1903,12 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops,
@@ -41 +43 @@
-@@ -3500,7 +3499,7 @@ dpaa_sec_process_atomic_event(void *event,
+@@ -3447,7 +3446,7 @@ dpaa_sec_process_atomic_event(void *event,
More information about the stable
mailing list