From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 81DED1C4A for ; Fri, 12 May 2017 17:41:39 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 May 2017 08:41:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,330,1491289200"; d="scan'208";a="101338486" Received: from sivswdev03.ir.intel.com (HELO localhost.localdomain) ([10.237.217.157]) by fmsmga006.fm.intel.com with ESMTP; 12 May 2017 08:41:37 -0700 From: Arek Kusztal To: stable@dpdk.org Cc: pablo.de.lara.guarch@intel.com, Arkadiusz Kusztal Date: Fri, 12 May 2017 16:41:34 +0100 Message-Id: <1494603694-5389-2-git-send-email-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1494603694-5389-1-git-send-email-arkadiuszx.kusztal@intel.com> References: <1494603694-5389-1-git-send-email-arkadiuszx.kusztal@intel.com> Subject: [dpdk-stable] [PATCH] crypto/qat: fix segmentation fault in session create X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 May 2017 15:41:40 -0000 From: Arkadiusz Kusztal This patch fixes segementation fault that may occur in case of wrong parameters being provided to the cryptographic session. Unused fields which would cause null dereference are removed. Fixes: 1703e94ac5ce ("qat: add driver for QuickAssist devices") [ backported from upstream commit d099195ae7e0a64aaeba6fed290536f403dd5fe0] Signed-off-by: Arek Kusztal Acked-by: Fiona Trahe --- drivers/crypto/qat/qat_crypto.c | 13 ++----------- drivers/crypto/qat/qat_crypto.h | 3 --- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c index 798cd98..540de59 100644 --- a/drivers/crypto/qat/qat_crypto.c +++ b/drivers/crypto/qat/qat_crypto.c @@ -573,11 +573,9 @@ qat_get_cipher_xform(struct rte_crypto_sym_xform *xform) return NULL; } void * -qat_crypto_sym_configure_session_cipher(struct rte_cryptodev *dev, +qat_crypto_sym_configure_session_cipher(struct rte_cryptodev *dev __rte_unused, struct rte_crypto_sym_xform *xform, void *session_private) { - struct qat_pmd_private *internals = dev->data->dev_private; - struct qat_session *session = session_private; struct rte_crypto_cipher_xform *cipher_xform = NULL; @@ -674,7 +672,6 @@ qat_crypto_sym_configure_session_cipher(struct rte_cryptodev *dev, return session; error_out: - rte_mempool_put(internals->sess_mp, session); return NULL; } @@ -683,8 +680,6 @@ void * qat_crypto_sym_configure_session(struct rte_cryptodev *dev, struct rte_crypto_sym_xform *xform, void *session_private) { - struct qat_pmd_private *internals = dev->data->dev_private; - struct qat_session *session = session_private; int qat_cmd_id; @@ -733,17 +728,15 @@ qat_crypto_sym_configure_session(struct rte_cryptodev *dev, return session; error_out: - rte_mempool_put(internals->sess_mp, session); return NULL; } struct qat_session * -qat_crypto_sym_configure_session_auth(struct rte_cryptodev *dev, +qat_crypto_sym_configure_session_auth(struct rte_cryptodev *dev __rte_unused, struct rte_crypto_sym_xform *xform, struct qat_session *session_private) { - struct qat_pmd_private *internals = dev->data->dev_private; struct qat_session *session = session_private; struct rte_crypto_auth_xform *auth_xform = NULL; struct rte_crypto_cipher_xform *cipher_xform = NULL; @@ -828,8 +821,6 @@ qat_crypto_sym_configure_session_auth(struct rte_cryptodev *dev, return session; error_out: - if (internals->sess_mp != NULL) - rte_mempool_put(internals->sess_mp, session); return NULL; } diff --git a/drivers/crypto/qat/qat_crypto.h b/drivers/crypto/qat/qat_crypto.h index 0afe74e..a3643b5 100644 --- a/drivers/crypto/qat/qat_crypto.h +++ b/drivers/crypto/qat/qat_crypto.h @@ -72,9 +72,6 @@ struct qat_qp { /** private data structure for each QAT device */ struct qat_pmd_private { - char sess_mp_name[RTE_MEMPOOL_NAMESIZE]; - struct rte_mempool *sess_mp; - unsigned max_nb_queue_pairs; /**< Max number of queue pairs supported by device */ unsigned max_nb_sessions; -- 2.1.0