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 B628CA00BE for ; Wed, 9 Mar 2022 16:08:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A22E1410E8; Wed, 9 Mar 2022 16:08:41 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id A51C740395; Wed, 9 Mar 2022 16:08:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646838520; x=1678374520; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IYVnTVLh/JeI+zT+xgwDpkCRkHnqai6h27um3Gv1SG4=; b=PvBNgKed5al83hGezUSNnrqlbQrZmYUIQGYvvLgIphL9yx3A+3FJNw+s aWZkPhDb4LcR7tU0L16EyZlRoQ0msSjytIc/NRjg3ZintWSefSvr7L7qz 9ulGCBhcQ5gdS24sU2Egm7TvqgtXeHaeCEgmL/53rSEjfXuVdU4Ug9BFl OG2/T8R7+yl7XVATbLxWOUS2gWFCUVX8Je/ze0LZgVojO+CjX6jdhGoXc foeUN1PPVb4ZS9MhJLFioIxTOwi4aGYTTPpF2Sp+VhGMU+22TxV8SaU8C wWxIEGvL6/S6dIJ6FuKwXOvBk2vW+WvVSHi/BMlltg6ewlBXKVI1ewMmF w==; X-IronPort-AV: E=McAfee;i="6200,9189,10281"; a="235601659" X-IronPort-AV: E=Sophos;i="5.90,167,1643702400"; d="scan'208";a="235601659" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2022 07:08:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,167,1643702400"; d="scan'208";a="538032572" Received: from silpixa00400320.ir.intel.com ([10.237.214.242]) by orsmga007.jf.intel.com with ESMTP; 09 Mar 2022 07:08:36 -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 v3] crypto/ipsec_mb: fix coverity issue Date: Wed, 9 Mar 2022 15:08:27 +0000 Message-Id: <20220309150827.1842599-1-piotrx.bronowski@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220307153233.1407564-1-piotrx.bronowski@intel.com> References: <20220307153233.1407564-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: 918fd2f1466b ("crypto/ipsec_mb: move aesni_mb PMD") Signed-off-by: Piotr Bronowski Cc: stable@dpdk.org --- v3: use a different logic to check digest length --- 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.