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 EE674A0093; Mon, 7 Mar 2022 13:48:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D46E84118F; Mon, 7 Mar 2022 13:48:33 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 8B85C4068F for ; Mon, 7 Mar 2022 13:48:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646657312; x=1678193312; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Fuh8jg3j8wRv/c250I+WPnSW2x/0BnQPp7m+tmxTqHY=; b=B0TeW8KJbMCcxf3s60C0yt41VIYxD34iBBvKERGoBCagX+A/XK+gaYlU tsfqQaaHkB5c65MS0Ij4ALMQELlkRGMUfwR19S3r9xdmd8b6caaDcHa5e wUsngxCWhMROa0l/uCoADgjv0YFPJipIAhLSejbU/gtX4rMRdezDozAHs lfqO42nXDz/DmxVCPnJ74u/vlONyUz8vBMzg5sJhv8U4UKB9Ee5BdMBkY Ckyt9ibArz/mY3oddMaG2WwY9dNmbSagS7t7I6Q2ZX+/ESz1HZnQert6N ZUymR/QsNeb9t2EQsR4t9nJOvGUougf6nj2YWVMEAAXA12ZqxP4GlC3st A==; X-IronPort-AV: E=McAfee;i="6200,9189,10278"; a="251954990" X-IronPort-AV: E=Sophos;i="5.90,162,1643702400"; d="scan'208";a="251954990" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 04:48:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,162,1643702400"; d="scan'208";a="812994240" Received: from silpixa00400320.ir.intel.com ([10.237.214.242]) by fmsmga005.fm.intel.com with ESMTP; 07 Mar 2022 04:48:29 -0800 From: Piotr Bronowski To: dev@dpdk.org Cc: roy.fan.zhang@intel.com, thomas@monjalon.net, gakhil@marvell.com, ferruh.yigit@intel.com, declan.doherty@intel.com, Piotr Bronowski Subject: [PATCH] crypto/ipsec_mb: fix usage of untrusted value Date: Mon, 7 Mar 2022 12:48:02 +0000 Message-Id: <20220307124802.1371808-1-piotrx.bronowski@intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This patch removes coverity defect CID 375828: Untrusted value as argument (TAINTED_SCALAR) Coverity issue: CID 375828 Fixes: 918fd2f1466b ("crypto/ipsec_mb: move aesni_mb PMD") Signed-off-by: Piotr Bronowski --- drivers/crypto/ipsec_mb/pmd_aesni_gcm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_gcm.c b/drivers/crypto/ipsec_mb/pmd_aesni_gcm.c index e5ad629fe5..f735b77680 100644 --- a/drivers/crypto/ipsec_mb/pmd_aesni_gcm.c +++ b/drivers/crypto/ipsec_mb/pmd_aesni_gcm.c @@ -206,6 +206,9 @@ post_process_gcm_crypto_op(struct ipsec_mb_qp *qp, op->status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED; } else { if (session->req_digest_length != session->gen_digest_length) { + session->req_digest_length = + RTE_MIN(session->req_digest_length, + DIGEST_LENGTH_MAX); if (session->op == IPSEC_MB_OP_AEAD_AUTHENTICATED_ENCRYPT) memcpy(op->sym->aead.digest.data, -- 2.30.2 -------------------------------------------------------------- Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.