From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id B174D2C54 for ; Mon, 8 Apr 2019 14:09:36 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Apr 2019 05:09:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,325,1549958400"; d="scan'208";a="140982589" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by fmsmga007.fm.intel.com with ESMTP; 08 Apr 2019 05:09:34 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.31]) by IRSMSX101.ger.corp.intel.com ([169.254.1.115]) with mapi id 14.03.0415.000; Mon, 8 Apr 2019 13:09:33 +0100 From: "Ananyev, Konstantin" To: "Iremonger, Bernard" , "dev@dpdk.org" , "Trahe, Fiona" , "akhil.goyal@nxp.com" Thread-Topic: [PATCH] crypto/qat: fix segmentation fault in QAT PMD Thread-Index: AQHU7fi6FHo3hhV3I0u+RowCL8yV26YyKusA Date: Mon, 8 Apr 2019 12:09:33 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772580148A9449B@irsmsx105.ger.corp.intel.com> References: <1554720537-14959-1-git-send-email-bernard.iremonger@intel.com> In-Reply-To: <1554720537-14959-1-git-send-email-bernard.iremonger@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWVjMGU5ZjEtN2RlYy00MmJhLWE0ZWQtOTg2YzRjMDEyNDg5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZjZTY2FzSXFPM2dFQXZlY2pHT1wvZldWOHFnVzJmNzV5VmxYXC8wdDgxXC9zZFVqTEFrQ0dQXC85ZjVqOTFoMVJuTHMifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Apr 2019 12:09:37 -0000 Hi Bernard, >=20 > While running the IPsec unit test program the following > segmentation fault is occurring: >=20 > Thread 1 "test" received signal SIGSEGV, Segmentation fault. > 0x0000000000beaece in qat_sym_build_request(in_op=3D0x0, > out_msg=3D0x100450580 "", op_cookie=3D0x101c6fd80, qat_dev_gen=3DQAT_GEN1= ) > at /root/dpdk_ipsec_master-1/drivers/crypto/qat/qat_sym.c:165 > 165 if (unlikely(op->type !=3D RTE_CRYPTO_OP_TYPE_SYMMETRIC)) { >=20 > Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriente= d") > Signed-off-by: Bernard Iremonger > --- > drivers/crypto/qat/qat_sym.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c > index 8801ca5..4a7d11e 100644 > --- a/drivers/crypto/qat/qat_sym.c > +++ b/drivers/crypto/qat/qat_sym.c > @@ -162,6 +162,12 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg, > struct qat_sym_op_cookie *cookie =3D > (struct qat_sym_op_cookie *)op_cookie; >=20 > + if (op =3D=3D NULL) { > + QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto " > + "operation requests, op (%p) is NULL", op); > + return -EINVAL; > + } > + > if (unlikely(op->type !=3D RTE_CRYPTO_OP_TYPE_SYMMETRIC)) { > QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto " > "operation requests, op (%p) is not a " This is crypto-dev enqueue data-path, if I am not mistaken. I think in that case it is caller responsibility to make sure that ops[] co= ntain valid crypto-ops (as in majority of other data-path functions). Suppose the main question here - why ipsec UT passes NULL as crypto-op here= ? Konstantin From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id DDCD7A0096 for ; Mon, 8 Apr 2019 14:09:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3C7414C8F; Mon, 8 Apr 2019 14:09:38 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id B174D2C54 for ; Mon, 8 Apr 2019 14:09:36 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Apr 2019 05:09:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,325,1549958400"; d="scan'208";a="140982589" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by fmsmga007.fm.intel.com with ESMTP; 08 Apr 2019 05:09:34 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.31]) by IRSMSX101.ger.corp.intel.com ([169.254.1.115]) with mapi id 14.03.0415.000; Mon, 8 Apr 2019 13:09:33 +0100 From: "Ananyev, Konstantin" To: "Iremonger, Bernard" , "dev@dpdk.org" , "Trahe, Fiona" , "akhil.goyal@nxp.com" Thread-Topic: [PATCH] crypto/qat: fix segmentation fault in QAT PMD Thread-Index: AQHU7fi6FHo3hhV3I0u+RowCL8yV26YyKusA Date: Mon, 8 Apr 2019 12:09:33 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772580148A9449B@irsmsx105.ger.corp.intel.com> References: <1554720537-14959-1-git-send-email-bernard.iremonger@intel.com> In-Reply-To: <1554720537-14959-1-git-send-email-bernard.iremonger@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWVjMGU5ZjEtN2RlYy00MmJhLWE0ZWQtOTg2YzRjMDEyNDg5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZjZTY2FzSXFPM2dFQXZlY2pHT1wvZldWOHFnVzJmNzV5VmxYXC8wdDgxXC9zZFVqTEFrQ0dQXC85ZjVqOTFoMVJuTHMifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190408120933.KhgnZzMOszFoVpsybly9f-JE2Y2_HdNdeQXwKylHSlY@z> Hi Bernard, >=20 > While running the IPsec unit test program the following > segmentation fault is occurring: >=20 > Thread 1 "test" received signal SIGSEGV, Segmentation fault. > 0x0000000000beaece in qat_sym_build_request(in_op=3D0x0, > out_msg=3D0x100450580 "", op_cookie=3D0x101c6fd80, qat_dev_gen=3DQAT_GEN1= ) > at /root/dpdk_ipsec_master-1/drivers/crypto/qat/qat_sym.c:165 > 165 if (unlikely(op->type !=3D RTE_CRYPTO_OP_TYPE_SYMMETRIC)) { >=20 > Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriente= d") > Signed-off-by: Bernard Iremonger > --- > drivers/crypto/qat/qat_sym.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c > index 8801ca5..4a7d11e 100644 > --- a/drivers/crypto/qat/qat_sym.c > +++ b/drivers/crypto/qat/qat_sym.c > @@ -162,6 +162,12 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg, > struct qat_sym_op_cookie *cookie =3D > (struct qat_sym_op_cookie *)op_cookie; >=20 > + if (op =3D=3D NULL) { > + QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto " > + "operation requests, op (%p) is NULL", op); > + return -EINVAL; > + } > + > if (unlikely(op->type !=3D RTE_CRYPTO_OP_TYPE_SYMMETRIC)) { > QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto " > "operation requests, op (%p) is not a " This is crypto-dev enqueue data-path, if I am not mistaken. I think in that case it is caller responsibility to make sure that ops[] co= ntain valid crypto-ops (as in majority of other data-path functions). Suppose the main question here - why ipsec UT passes NULL as crypto-op here= ? Konstantin