patch 'crypto/virtio: fix cipher data source length' has been queued to stable release 23.11.5
Xueming Li
xuemingl at nvidia.com
Thu Jun 26 14:00:37 CEST 2025
Hi,
FYI, your patch has been queued to stable release 23.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 06/28/25. 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://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=c2f499a7e97d138254264945ea77cf412feac0b8
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From c2f499a7e97d138254264945ea77cf412feac0b8 Mon Sep 17 00:00:00 2001
From: Rajesh Mudimadugula <rmudimadugul at marvell.com>
Date: Thu, 3 Apr 2025 12:26:03 +0000
Subject: [PATCH] crypto/virtio: fix cipher data source length
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit fcb4d1f48e4aecb6be4ef7a4f6f25df24fee0ea2 ]
In symmetric algorithm chaining, we need to consider both
cipher and auth data length for cipher source.
Fixes: 82adb12a1fce ("crypto/virtio: support burst enqueue/dequeue")
Signed-off-by: Rajesh Mudimadugula <rmudimadugul at marvell.com>
Acked-by: Akhil Goyal <gakhil at marvell.com>
---
drivers/crypto/virtio/virtio_rxtx.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/crypto/virtio/virtio_rxtx.c b/drivers/crypto/virtio/virtio_rxtx.c
index d02486661f..01977c7ec4 100644
--- a/drivers/crypto/virtio/virtio_rxtx.c
+++ b/drivers/crypto/virtio/virtio_rxtx.c
@@ -157,8 +157,10 @@ virtqueue_crypto_sym_pkt_header_arrange(
req_data->u.sym_req.u.chain.para.aad_len = session->aad.length;
req_data->u.sym_req.u.chain.para.src_data_len =
- (sym_op->cipher.data.length +
- sym_op->cipher.data.offset);
+ RTE_MAX((sym_op->cipher.data.length +
+ sym_op->cipher.data.offset),
+ (sym_op->auth.data.length +
+ sym_op->auth.data.offset));
req_data->u.sym_req.u.chain.para.dst_data_len =
req_data->u.sym_req.u.chain.para.src_data_len;
req_data->u.sym_req.u.chain.para.cipher_start_src_offset =
@@ -212,6 +214,7 @@ virtqueue_crypto_sym_enqueue_xmit(
uint32_t hash_result_len = 0;
struct virtio_crypto_op_cookie *crypto_op_cookie;
struct virtio_crypto_alg_chain_session_para *para;
+ uint32_t src_len;
if (unlikely(sym_op->m_src->nb_segs != 1))
return -EMSGSIZE;
@@ -285,21 +288,22 @@ virtqueue_crypto_sym_enqueue_xmit(
desc[idx++].flags = VRING_DESC_F_NEXT;
}
+ src_len = RTE_MAX((sym_op->cipher.data.offset +
+ sym_op->cipher.data.length),
+ (sym_op->auth.data.length +
+ sym_op->auth.data.offset));
/* indirect vring: src data */
desc[idx].addr = rte_pktmbuf_iova_offset(sym_op->m_src, 0);
- desc[idx].len = (sym_op->cipher.data.offset
- + sym_op->cipher.data.length);
+ desc[idx].len = src_len;
desc[idx++].flags = VRING_DESC_F_NEXT;
/* indirect vring: dst data */
if (sym_op->m_dst) {
desc[idx].addr = rte_pktmbuf_iova_offset(sym_op->m_dst, 0);
- desc[idx].len = (sym_op->cipher.data.offset
- + sym_op->cipher.data.length);
+ desc[idx].len = src_len;
} else {
desc[idx].addr = rte_pktmbuf_iova_offset(sym_op->m_src, 0);
- desc[idx].len = (sym_op->cipher.data.offset
- + sym_op->cipher.data.length);
+ desc[idx].len = src_len;
}
desc[idx++].flags = VRING_DESC_F_WRITE | VRING_DESC_F_NEXT;
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-06-26 19:59:18.474647199 +0800
+++ 0017-crypto-virtio-fix-cipher-data-source-length.patch 2025-06-26 19:59:17.226418051 +0800
@@ -1 +1 @@
-From fcb4d1f48e4aecb6be4ef7a4f6f25df24fee0ea2 Mon Sep 17 00:00:00 2001
+From c2f499a7e97d138254264945ea77cf412feac0b8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit fcb4d1f48e4aecb6be4ef7a4f6f25df24fee0ea2 ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -19 +21 @@
-index 0cc904485c..a7f1bd9753 100644
+index d02486661f..01977c7ec4 100644
@@ -22 +24 @@
-@@ -243,8 +243,10 @@ virtqueue_crypto_sym_pkt_header_arrange(
+@@ -157,8 +157,10 @@ virtqueue_crypto_sym_pkt_header_arrange(
@@ -35 +37 @@
-@@ -298,6 +300,7 @@ virtqueue_crypto_sym_enqueue_xmit_split(
+@@ -212,6 +214,7 @@ virtqueue_crypto_sym_enqueue_xmit(
@@ -43 +45 @@
-@@ -371,21 +374,22 @@ virtqueue_crypto_sym_enqueue_xmit_split(
+@@ -285,21 +288,22 @@ virtqueue_crypto_sym_enqueue_xmit(
More information about the stable
mailing list