From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C8818A00BE for ; Fri, 18 Feb 2022 17:34:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C059341140; Fri, 18 Feb 2022 17:34:58 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 5DB3940E28; Fri, 18 Feb 2022 17:34:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645202096; x=1676738096; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/j17sG4D23+B4zPQiDj1DUH8r0DJGveA/cIAqkkmaTk=; b=liBS6s+IUNaGQhrA82JwNMOoMx2ZrY27FSc47C+k2duiAm+V0KJTMOId HY8EA0rqluPn0f63N6E/73NCrKEZetiXAaAfUyXFCbelEnjOBiLuM4Feg nx82uwl7PJEWDNvNCOKA0y6NdX5nvcM3X8n/FinTosSWrMGUZDXvnV35Q j8ijahQiT15huo39f6OIGDdGEMl/jqAnjJt/8JXsRJQS/rl9/ucDzJ4P8 dYR0sk4kQmz56vofBF9/cCVZ8bVXpTLxCcve8B6xPSec4DiExInQlNRmq 9IZVeeBaly85FdymGOmzzVr2y23EWo3P5y1eK3vsowbsUU1zKYlBwCFws Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="275757267" X-IronPort-AV: E=Sophos;i="5.88,379,1635231600"; d="scan'208";a="275757267" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2022 08:34:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,379,1635231600"; d="scan'208";a="546343807" Received: from silpixa00400493.ir.intel.com ([10.237.213.136]) by orsmga008.jf.intel.com with ESMTP; 18 Feb 2022 08:34:53 -0800 From: Pablo de Lara To: roy.fan.zhang@intel.com Cc: dev@dpdk.org, Pablo de Lara , piotrx.bronowski@intel.com, stable@dpdk.org Subject: [PATCH 1/4] crypto/ipsec_mb: check for missing operation types Date: Fri, 18 Feb 2022 16:34:40 +0000 Message-Id: <20220218163443.3520756-2-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220218163443.3520756-1-pablo.de.lara.guarch@intel.com> References: <20220218163443.3520756-1-pablo.de.lara.guarch@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 --- 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