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 F308FA0093; Fri, 10 Dec 2021 15:10:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E1684426DC; Fri, 10 Dec 2021 15:10:13 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id A63EC426DA; Fri, 10 Dec 2021 15:10:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639145411; x=1670681411; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=h6ipAbblu1FzKjzbDTsYQ8Jyb0i4w76Vp0s042aVQyk=; b=QnTFSbF2xL+Wahjc7nC4Hy9Kfhth5ZirSvf2p6jqrB1sh3gwbplsrauj 46y78BcIENTbFnc+OV/G71Ec/+900PM3XSK3octY2lRSW/0bIAgnZZLQs 8bmYi08emihkVXbT46552HowQ3c/epEyyR2UG9hPl6NzZw0nAef7ktY/F l2WNh5GuXYtZHX4OZzQY8h+41vGktLqyJ0iyYsXg99ZhjVxWEXPeC489x 14u8FAPlj1QLuH5nTAA1DfBDUCfTML5D0BWJWqi+iEJ5244QUCk/HdJTI QBTNLsUuPHfEIkrFSGNf2Fr6kV1dQ97ADqQQsjhClc0bJ3hsxUS3n77Gb w==; X-IronPort-AV: E=McAfee;i="6200,9189,10193"; a="324613227" X-IronPort-AV: E=Sophos;i="5.88,195,1635231600"; d="scan'208";a="324613227" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 06:10:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,195,1635231600"; d="scan'208";a="612937013" Received: from silpixa00400355.ir.intel.com (HELO silpixa00400355.ger.corp.intel.com) ([10.237.222.49]) by orsmga004.jf.intel.com with ESMTP; 10 Dec 2021 06:10:08 -0800 From: Ciara Power To: dev@dpdk.org Cc: stable@dpdk.org, john.mcnamara@intel.com, roy.fan.zhang@intel.com, Ciara Power , piotrx.bronowski@intel.com, Pablo de Lara Subject: [PATCH 3/3] crypto/ipsec_mb: fix tainted data for session Date: Fri, 10 Dec 2021 14:09:52 +0000 Message-Id: <20211210140952.2907974-3-ciara.power@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211210140952.2907974-1-ciara.power@intel.com> References: <20211210140952.2907974-1-ciara.power@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Downcasting a void * to struct aesni_gcm_session * caused the session data to be treated as tainted. Removing the void * temporary variable and adding a cast avoids this issue. Coverity issue: 374377 Fixes: 746825e5c0ea ("crypto/ipsec_mb: move aesni_gcm PMD") Cc: piotrx.bronowski@intel.com Cc: stable@dpdk.org Signed-off-by: Ciara Power --- drivers/crypto/ipsec_mb/pmd_aesni_gcm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_gcm.c b/drivers/crypto/ipsec_mb/pmd_aesni_gcm.c index 2c203795ab..e5ad629fe5 100644 --- a/drivers/crypto/ipsec_mb/pmd_aesni_gcm.c +++ b/drivers/crypto/ipsec_mb/pmd_aesni_gcm.c @@ -713,19 +713,17 @@ aesni_gcm_process_bulk(struct rte_cryptodev *dev, __rte_unused union rte_crypto_sym_ofs ofs, struct rte_crypto_sym_vec *vec) { - void *sess_priv; struct aesni_gcm_session *s; struct gcm_context_data gdata_ctx; IMB_MGR *mb_mgr; - sess_priv = get_sym_session_private_data(sess, dev->driver_id); - if (unlikely(sess_priv == NULL)) { + s = (struct aesni_gcm_session *) get_sym_session_private_data(sess, + dev->driver_id); + if (unlikely(s == NULL)) { aesni_gcm_fill_error_code(vec, EINVAL); return 0; } - s = sess_priv; - /* get per-thread MB MGR, create one if needed */ mb_mgr = get_per_thread_mb_mgr(); if (unlikely(mb_mgr == NULL)) -- 2.25.1