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 630A8A00C4 for ; Wed, 23 Feb 2022 17:02:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 534F84271A; Wed, 23 Feb 2022 17:02:08 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 52FFC42711; Wed, 23 Feb 2022 17:02:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645632125; x=1677168125; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/j17sG4D23+B4zPQiDj1DUH8r0DJGveA/cIAqkkmaTk=; b=PP1TgOQJqsDtoCkbXYsSHZEefpnDVSfJdgnG9+jjXQm5zzmRaaN7Do+K zNdoV1SIPcv6h0W81YurFZmdM3O3hFPLKyfo23ANK+MF0f493kUf/kOTc OOIVYUveyQOB+s/HjLKT5PF9ShHrhQBp+CHjgtjFDonCKkuX0DAqA+xdp Lcpp3at/EywsICdNmO7NDOhZhg98PGpsicO3afo5rEilXsRHXw5mu40yY lNbOdkQQOheP47lM1zn7lM2IpMlYY/KlnasuDjnA2CcJEkEiQ78LcXOL2 e6IuB1pIkQlUGtucwQFF2z97nNRhCHjd7cC4K/poWwM9Os7eV3jYs13C+ Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10267"; a="312712115" X-IronPort-AV: E=Sophos;i="5.88,391,1635231600"; d="scan'208";a="312712115" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 08:01:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,391,1635231600"; d="scan'208";a="508485177" Received: from silpixa00400636.ir.intel.com ([10.237.213.19]) by orsmga006.jf.intel.com with ESMTP; 23 Feb 2022 08:01:31 -0800 From: Pablo de Lara To: roy.fan.zhang@intel.com, gakhil@marvell.com Cc: dev@dpdk.org, Pablo de Lara , 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 Message-Id: <20220223160116.736804-2-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220223160116.736804-1-pablo.de.lara.guarch@intel.com> References: <20220218163443.3520756-1-pablo.de.lara.guarch@intel.com> <20220223160116.736804-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