public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: "weid wei.dai@picocom.com" <wei.dai@picocom.com>
To: <kai.ji@intel.com>, <pablo.de.lara.guarch@intel.com>
Cc: <dev@dpdk.org>, "weid" <wei.dai@picocom.com>
Subject: [PATCH] crypto/ipsec_mb: fix clearing snow3g digest
Date: Fri, 16 Jan 2026 19:57:17 +0800	[thread overview]
Message-ID: <20260116115718.1500-1-wei.dai@picocom.com> (raw)

From: weid <wei.dai@picocom.com>

Before this patch, the software crypto_snow3g
clear the encrypted auth snow3g digest when
the dst mbuf is same as the src mbuf in crypto
op.

This bug can be checked by following way,
start app/dpdk-test --vdev=crypto_snow3g,
run pdcp_autotest
the case failed when i=42 in
run_test_for_one_known_vec() in test_pdcp.c.
The case is PDCP control plane auth snow3g gen
+ cipher snow3g enc.
The case failed because the last 4 bytes are
cleared in last for() loop in line 167 in
process_snow3g_cipher_op() in pmd_snow3g.c .

Fixes: 5208d68d30cb ("crypto/ipsec_mb: support snow3g digest appended
ops")

Signed-off-by: weid <wei.dai@picocom.com>
---
 drivers/crypto/ipsec_mb/pmd_snow3g.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/ipsec_mb/pmd_snow3g.c b/drivers/crypto/ipsec_mb/pmd_snow3g.c
index b3c3b05a8a..35fe23c157 100644
--- a/drivers/crypto/ipsec_mb/pmd_snow3g.c
+++ b/drivers/crypto/ipsec_mb/pmd_snow3g.c
@@ -157,7 +157,8 @@ process_snow3g_cipher_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops,
 	for (i = 0; i < num_ops; i++) {
 		if ((session->op == IPSEC_MB_OP_HASH_VERIFY_THEN_DECRYPT ||
 			session->op == IPSEC_MB_OP_HASH_GEN_THEN_ENCRYPT) &&
-				ops[i]->sym->m_dst != NULL) {
+				ops[i]->sym->m_dst != NULL &&
+				ops[i]->sym->m_dst != ops[i]->sym->m_src) {
 			digest_appended[i] =
 				snow3g_digest_appended_in_src(ops[i]);
 			/* Clear unencrypted digest from
-- 
2.51.0.windows.1

             reply	other threads:[~2026-01-19 11:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-16 11:57 weid wei.dai@picocom.com [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-01-20  6:12 [PATCH] crypto/ipsec_mb: fix clearing snow3g digest weid wei.dai@picocom.com

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=20260116115718.1500-1-wei.dai@picocom.com \
    --to=wei.dai@picocom.com \
    --cc=dev@dpdk.org \
    --cc=kai.ji@intel.com \
    --cc=pablo.de.lara.guarch@intel.com \
    /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