From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: roy.fan.zhang@intel.com, gakhil@marvell.com
Cc: dev@dpdk.org, Pablo de Lara <pablo.de.lara.guarch@intel.com>,
piotrx.bronowski@intel.com, stable@dpdk.org
Subject: [PATCH v2 1/4] crypto/ipsec_mb: check for missing operation types
Date: Wed, 23 Feb 2022 16:01:13 +0000 [thread overview]
Message-ID: <20220223160116.736804-2-pablo.de.lara.guarch@intel.com> (raw)
In-Reply-To: <20220223160116.736804-1-pablo.de.lara.guarch@intel.com>
When processing crypto operations in ZUC PMD,
there were two operation types that were set at session level,
but not checked when the operations are enqueued and processed,
leaving the buffers untouched silently.
Fixes: cde8df1bda9d ("crypto/ipsec_mb: move zuc PMD")
Cc: piotrx.bronowski@intel.com
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
drivers/crypto/ipsec_mb/pmd_zuc.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/ipsec_mb/pmd_zuc.c b/drivers/crypto/ipsec_mb/pmd_zuc.c
index 2eae1d1ec7..ec83d96dfc 100644
--- a/drivers/crypto/ipsec_mb/pmd_zuc.c
+++ b/drivers/crypto/ipsec_mb/pmd_zuc.c
@@ -198,7 +198,7 @@ process_ops(struct rte_crypto_op **ops, enum ipsec_mb_operation op_type,
struct ipsec_mb_qp *qp, uint8_t num_ops)
{
unsigned int i;
- unsigned int processed_ops;
+ unsigned int processed_ops = 0;
switch (op_type) {
case IPSEC_MB_OP_ENCRYPT_ONLY:
@@ -212,18 +212,21 @@ process_ops(struct rte_crypto_op **ops, enum ipsec_mb_operation op_type,
num_ops);
break;
case IPSEC_MB_OP_ENCRYPT_THEN_HASH_GEN:
+ case IPSEC_MB_OP_DECRYPT_THEN_HASH_VERIFY:
processed_ops = process_zuc_cipher_op(qp, ops, sessions,
num_ops);
process_zuc_hash_op(qp, ops, sessions, processed_ops);
break;
case IPSEC_MB_OP_HASH_VERIFY_THEN_DECRYPT:
+ case IPSEC_MB_OP_HASH_GEN_THEN_ENCRYPT:
processed_ops = process_zuc_hash_op(qp, ops, sessions,
num_ops);
process_zuc_cipher_op(qp, ops, sessions, processed_ops);
break;
default:
/* Operation not supported. */
- processed_ops = 0;
+ for (i = 0; i < num_ops; i++)
+ ops[i]->status = RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
}
for (i = 0; i < num_ops; i++) {
--
2.25.1
next prev parent reply other threads:[~2022-02-23 16:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220218163443.3520756-1-pablo.de.lara.guarch@intel.com>
2022-02-18 16:34 ` [PATCH " Pablo de Lara
2022-02-18 16:34 ` [PATCH 2/4] crypto/ipsec_mb: fix ZUC authentication verify Pablo de Lara
2022-02-18 16:34 ` [PATCH 3/4] crypto/ipsec_mb: fix crypto operation overwrite Pablo de Lara
2022-02-18 16:34 ` [PATCH 4/4] crypto/ipsec_mb: fix length and offset settings Pablo de Lara
2022-02-22 19:30 ` [EXT] " Akhil Goyal
[not found] ` <20220223160116.736804-1-pablo.de.lara.guarch@intel.com>
2022-02-23 16:01 ` Pablo de Lara [this message]
2022-02-23 16:01 ` [PATCH v2 2/4] crypto/ipsec_mb: fix ZUC authentication verify Pablo de Lara
2022-02-23 16:01 ` [PATCH v2 3/4] crypto/ipsec_mb: fix crypto operation overwrite Pablo de Lara
2022-02-23 16:01 ` [PATCH v2 4/4] crypto/ipsec_mb: fix length and offset settings Pablo de Lara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220223160116.736804-2-pablo.de.lara.guarch@intel.com \
--to=pablo.de.lara.guarch@intel.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=piotrx.bronowski@intel.com \
--cc=roy.fan.zhang@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).