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 5FB1CA00BE for ; Wed, 9 Mar 2022 19:03:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 529A9410E6; Wed, 9 Mar 2022 19:03:12 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 7ACC64013F; Wed, 9 Mar 2022 19:03:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646848989; x=1678384989; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sYiQC+aRfwfCRROUFU4E/q64y5zA/6GjduRb8/K7GQY=; b=XkoMBrp85CSlp877L6sBV1hJdM44Z2TVNMQUDUp0ZBSgquDDVkD/7/G2 irczvjVcRRw1PkVNJAr0gdAlWsYEdUiSe/h0/rqGdCNXRzt9hHM73fDRp 7yEF6yhdjTtlPoNgeKArthv3g72f+/wgfOvwjX+3MJtoVj9W3SS1a4ynw qFaHv+ZjthwYItZvhS6PwJ7rJUiCDU/RrN7aoKI8qzlrZEfX2U+WRZUdD rfDh9XCHCkeUVAp4rVhFnv/gjZ2taLm4iR40fjE3SE49YS5QL2JeGBkYZ 4FZXhWZo8R3udPKLH8qggYDKp4bx65rRCQKqTu+QzdXNbPOwXPNVtdGn4 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10281"; a="341478579" X-IronPort-AV: E=Sophos;i="5.90,167,1643702400"; d="scan'208";a="341478579" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2022 10:02:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,167,1643702400"; d="scan'208";a="632696549" Received: from silpixa00400320.ir.intel.com ([10.237.214.242]) by FMSMGA003.fm.intel.com with ESMTP; 09 Mar 2022 10:02:07 -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 , stable@dpdk.org Subject: [PATCH v4] crypto/ipsec_mb: fix coverity issue Date: Wed, 9 Mar 2022 18:02:00 +0000 Message-Id: <20220309180200.1864114-1-piotrx.bronowski@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220309150827.1842599-1-piotrx.bronowski@intel.com> References: <20220309150827.1842599-1-piotrx.bronowski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 This patch removes coverity defect CID 375828: Untrusted value as argument (TAINTED_SCALAR) Coverity issue: CID 375828 Fixes: ceb863938708 ("crypto/aesni_gcm: support all truncated digest sizes") Signed-off-by: Piotr Bronowski Cc: stable@dpdk.org --- v4: commit message corrected --- drivers/crypto/ipsec_mb/pmd_aesni_gcm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_gcm.c b/drivers/crypto/ipsec_mb/pmd_aesni_gcm.c index e5ad629fe5..2c033c6f28 100644 --- a/drivers/crypto/ipsec_mb/pmd_aesni_gcm.c +++ b/drivers/crypto/ipsec_mb/pmd_aesni_gcm.c @@ -96,7 +96,9 @@ aesni_gcm_session_configure(IMB_MGR *mb_mgr, void *session, sess->iv.length = auth_xform->auth.iv.length; key_length = auth_xform->auth.key.length; key = auth_xform->auth.key.data; - sess->req_digest_length = auth_xform->auth.digest_length; + sess->req_digest_length = + RTE_MIN(auth_xform->auth.digest_length, + DIGEST_LENGTH_MAX); break; case IPSEC_MB_OP_AEAD_AUTHENTICATED_ENCRYPT: case IPSEC_MB_OP_AEAD_AUTHENTICATED_DECRYPT: @@ -116,7 +118,9 @@ aesni_gcm_session_configure(IMB_MGR *mb_mgr, void *session, key_length = aead_xform->aead.key.length; key = aead_xform->aead.key.data; sess->aad_length = aead_xform->aead.aad_length; - sess->req_digest_length = aead_xform->aead.digest_length; + sess->req_digest_length = + RTE_MIN(aead_xform->aead.digest_length, + DIGEST_LENGTH_MAX); break; default: IPSEC_MB_LOG( -- 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.