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 E8B089E3; Fri, 31 Mar 2017 00:11:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490911905; x=1522447905; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=MEDyt5yEDVH5poigPauy9BMFFORzvXU4oKv1+n2shHA=; b=kFE4pgJusNoRWoDycoQsztksgsTvLVqa18XhnTJCrFQSJqZbUi+sBgBa tFkdhBuZO/RF2ngeNEzzBayOfAZtYw==; Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Mar 2017 15:11:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,249,1486454400"; d="scan'208";a="67124569" Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by orsmga002.jf.intel.com with ESMTP; 30 Mar 2017 15:11:42 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.239]) by IRSMSX106.ger.corp.intel.com ([169.254.8.202]) with mapi id 14.03.0319.002; Thu, 30 Mar 2017 23:11:41 +0100 From: "De Lara Guarch, Pablo" To: "Kusztal, ArkadiuszX" , "dev@dpdk.org" CC: "Trahe, Fiona" , "Griffin, John" , "Jain, Deepak K" , "stable@dpdk.org" Thread-Topic: [PATCH] crypto/qat: fix segmentation fault in session create Thread-Index: AQHSqHewKQdSHke66E6GaeNbsk3w3qGt9AaA Date: Thu, 30 Mar 2017 22:11:41 +0000 Message-ID: References: <1490783506-18451-1-git-send-email-arkadiuszx.kusztal@intel.com> In-Reply-To: <1490783506-18451-1-git-send-email-arkadiuszx.kusztal@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzE1ZGI2NTUtY2FkMy00MTEzLWJjMmItYzVhZWM3N2UyNmYyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InBiTDdHakZyVUhjcThVZ0ttQlwvaGVFelJjdjRKdGlwRFwvXC80M2xoZVltQ2c9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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: Thu, 30 Mar 2017 22:11:45 -0000 CC'ing stable repo. > -----Original Message----- > From: Kusztal, ArkadiuszX > Sent: Wednesday, March 29, 2017 11:32 AM > To: dev@dpdk.org > Cc: Trahe, Fiona; De Lara Guarch, Pablo; Griffin, John; Jain, Deepak K; > Kusztal, ArkadiuszX > Subject: [PATCH] crypto/qat: fix segmentation fault in session create >=20 > 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. >=20 > Fixes: 1703e94ac5ce ("qat: add driver for QuickAssist devices") >=20 > This patchset depends on the following patches/patchsets: >=20 > "crypto/qat: adding docsisbpi mode support" > (http://dpdk.org/dev/patchwork/patch/21121/) >=20 > Signed-off-by: Arek Kusztal > --- > drivers/crypto/qat/qat_crypto.c | 13 ++----------- > drivers/crypto/qat/qat_crypto.h | 3 --- > 2 files changed, 2 insertions(+), 14 deletions(-) >=20 > diff --git a/drivers/crypto/qat/qat_crypto.c > b/drivers/crypto/qat/qat_crypto.c > index b851926..9310211 100644 > --- a/drivers/crypto/qat/qat_crypto.c > +++ b/drivers/crypto/qat/qat_crypto.c > @@ -739,11 +739,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 =3D dev->data->dev_private; > - > struct qat_session *session =3D session_private; >=20 > struct rte_crypto_cipher_xform *cipher_xform =3D NULL; > @@ -884,7 +882,6 @@ qat_crypto_sym_configure_session_cipher(struct > rte_cryptodev *dev, > bpi_cipher_ctx_free(session->bpi_ctx); > session->bpi_ctx =3D NULL; > } > - rte_mempool_put(internals->sess_mp, session); > return NULL; > } >=20 > @@ -893,8 +890,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 =3D dev->data->dev_private; > - > struct qat_session *session =3D session_private; >=20 > int qat_cmd_id; > @@ -943,17 +938,15 @@ qat_crypto_sym_configure_session(struct > rte_cryptodev *dev, > return session; >=20 > error_out: > - rte_mempool_put(internals->sess_mp, session); > return NULL; > } >=20 > 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) > { >=20 > - struct qat_pmd_private *internals =3D dev->data->dev_private; > struct qat_session *session =3D session_private; > struct rte_crypto_auth_xform *auth_xform =3D NULL; > struct rte_crypto_cipher_xform *cipher_xform =3D NULL; > @@ -1038,8 +1031,6 @@ qat_crypto_sym_configure_session_auth(struct > rte_cryptodev *dev, > return session; >=20 > error_out: > - if (internals->sess_mp !=3D NULL) > - rte_mempool_put(internals->sess_mp, session); > return NULL; > } >=20 > diff --git a/drivers/crypto/qat/qat_crypto.h > b/drivers/crypto/qat/qat_crypto.h > index 78bb2bc..67fa0e1 100644 > --- a/drivers/crypto/qat/qat_crypto.h > +++ b/drivers/crypto/qat/qat_crypto.h > @@ -76,9 +76,6 @@ struct qat_qp { >=20 > /** 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.7.4