patch 'crypto/dpaa2_sec: fix crypto operation pointer' has been queued to stable release 21.11.2

Kevin Traynor ktraynor at redhat.com
Tue May 10 14:30:07 CEST 2022


Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/15/22. 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/5e3a3f48d133a89176e07ce9ce91472c45acc673

Thanks.

Kevin

---
>From 5e3a3f48d133a89176e07ce9ce91472c45acc673 Mon Sep 17 00:00:00 2001
From: Gagandeep Singh <g.singh at nxp.com>
Date: Thu, 28 Apr 2022 17:17:29 +0530
Subject: [PATCH] crypto/dpaa2_sec: fix crypto operation pointer

[ upstream commit e3d264383b560a447806d9ff478bad234fda5675 ]

Driver is filling the crypto_op variable with an invalid value
for atomic and ordered events which can results into
segmentation fault.

This patch assigning the correct crypto_op and event buffer
pointers by extracting from FD.

Fixes: a77db24643b7 ("crypto/dpaa2_sec: support atomic queues")
Fixes: 4562de326d30 ("crypto/dpaa2_sec: support ordered queue")

Signed-off-by: Gagandeep Singh <g.singh at nxp.com>
Acked-by: Akhil Goyal <gakhil at marvell.com>
---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index c7651c3d6d..3bb78fa044 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -3752,5 +3752,5 @@ dpaa2_sec_process_atomic_event(struct qbman_swp *swp __rte_unused,
 {
 	uint8_t dqrr_index;
-	struct rte_crypto_op *crypto_op = (struct rte_crypto_op *)ev->event_ptr;
+	struct rte_crypto_op *crypto_op;
 	/* Prefetching mbuf */
 	rte_prefetch0((void *)(size_t)(DPAA2_GET_FD_ADDR(fd)-
@@ -3768,5 +3768,5 @@ dpaa2_sec_process_atomic_event(struct qbman_swp *swp __rte_unused,
 	ev->priority = rxq->ev.priority;
 
-	ev->event_ptr = sec_fd_to_mbuf(fd);
+	crypto_op = sec_fd_to_mbuf(fd);
 	dqrr_index = qbman_get_dqrr_idx(dq);
 	*dpaa2_seqn(crypto_op->sym->m_src) = dqrr_index + 1;
@@ -3774,4 +3774,5 @@ dpaa2_sec_process_atomic_event(struct qbman_swp *swp __rte_unused,
 	DPAA2_PER_LCORE_DQRR_HELD |= 1 << dqrr_index;
 	DPAA2_PER_LCORE_DQRR_MBUF(dqrr_index) = crypto_op->sym->m_src;
+	ev->event_ptr = crypto_op;
 }
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-05-10 13:24:22.360244950 +0100
+++ 0030-crypto-dpaa2_sec-fix-crypto-operation-pointer.patch	2022-05-10 13:24:21.626646389 +0100
@@ -1 +1 @@
-From e3d264383b560a447806d9ff478bad234fda5675 Mon Sep 17 00:00:00 2001
+From 5e3a3f48d133a89176e07ce9ce91472c45acc673 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e3d264383b560a447806d9ff478bad234fda5675 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -20,2 +21,2 @@
- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
+ drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
@@ -24 +25 @@
-index 86c8df241b..9f2b384af9 100644
+index c7651c3d6d..3bb78fa044 100644
@@ -27 +28,2 @@
-@@ -4020,5 +4020,5 @@ dpaa2_sec_process_atomic_event(struct qbman_swp *swp __rte_unused,
+@@ -3752,5 +3752,5 @@ dpaa2_sec_process_atomic_event(struct qbman_swp *swp __rte_unused,
+ {
@@ -29 +30,0 @@
- 	struct dpaa2_sec_qp *qp;
@@ -34 +35 @@
-@@ -4037,5 +4037,5 @@ dpaa2_sec_process_atomic_event(struct qbman_swp *swp __rte_unused,
+@@ -3768,5 +3768,5 @@ dpaa2_sec_process_atomic_event(struct qbman_swp *swp __rte_unused,
@@ -37,2 +38,2 @@
--	ev->event_ptr = sec_fd_to_mbuf(fd, qp);
-+	crypto_op = sec_fd_to_mbuf(fd, qp);
+-	ev->event_ptr = sec_fd_to_mbuf(fd);
++	crypto_op = sec_fd_to_mbuf(fd);
@@ -40,2 +41,2 @@
- 	*dpaa2_seqn(crypto_op->sym->m_src) = QBMAN_ENQUEUE_FLAG_DCA | dqrr_index;
-@@ -4043,4 +4043,5 @@ dpaa2_sec_process_atomic_event(struct qbman_swp *swp __rte_unused,
+ 	*dpaa2_seqn(crypto_op->sym->m_src) = dqrr_index + 1;
+@@ -3774,4 +3774,5 @@ dpaa2_sec_process_atomic_event(struct qbman_swp *swp __rte_unused,
@@ -44,20 +44,0 @@
-+	ev->event_ptr = crypto_op;
- }
- 
-@@ -4052,5 +4053,5 @@ dpaa2_sec_process_ordered_event(struct qbman_swp *swp,
- 				struct rte_event *ev)
- {
--	struct rte_crypto_op *crypto_op = (struct rte_crypto_op *)ev->event_ptr;
-+	struct rte_crypto_op *crypto_op;
- 	struct dpaa2_sec_qp *qp;
- 
-@@ -4070,5 +4071,5 @@ dpaa2_sec_process_ordered_event(struct qbman_swp *swp,
- 	ev->queue_id = rxq->ev.queue_id;
- 	ev->priority = rxq->ev.priority;
--	ev->event_ptr = sec_fd_to_mbuf(fd, qp);
-+	crypto_op = sec_fd_to_mbuf(fd, qp);
- 
- 	*dpaa2_seqn(crypto_op->sym->m_src) = DPAA2_ENQUEUE_FLAG_ORP;
-@@ -4079,4 +4080,5 @@ dpaa2_sec_process_ordered_event(struct qbman_swp *swp,
- 
- 	qbman_swp_dqrr_consume(swp, dq);



More information about the stable mailing list