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 1CB80A0096 for ; Wed, 10 Apr 2019 18:21:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A830B1B108; Wed, 10 Apr 2019 18:21:39 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id D24EF6833 for ; Wed, 10 Apr 2019 18:21:37 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2019 09:21:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,334,1549958400"; d="scan'208";a="134608675" Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by orsmga006.jf.intel.com with ESMTP; 10 Apr 2019 09:21:35 -0700 Received: from irsmsx156.ger.corp.intel.com (10.108.20.68) by IRSMSX106.ger.corp.intel.com (163.33.3.31) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 10 Apr 2019 17:21:34 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.82]) by IRSMSX156.ger.corp.intel.com ([169.254.3.53]) with mapi id 14.03.0415.000; Wed, 10 Apr 2019 17:21:34 +0100 From: "Iremonger, Bernard" To: "Trahe, Fiona" , "Ananyev, Konstantin" , "dev@dpdk.org" , "akhil.goyal@nxp.com" Thread-Topic: [PATCH] crypto/qat: fix segmentation fault in QAT PMD Thread-Index: AQHU7fi6dhdBMB+dvU20WYYq7PRToqYyGyWAgABItgCAAzKRYA== Date: Wed, 10 Apr 2019 16:21:33 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C260D878C8@IRSMSX108.ger.corp.intel.com> References: <1554720537-14959-1-git-send-email-bernard.iremonger@intel.com> <2601191342CEEE43887BDE71AB9772580148A9449B@irsmsx105.ger.corp.intel.com> <348A99DA5F5B7549AA880327E580B4358973BCD1@IRSMSX101.ger.corp.intel.com> In-Reply-To: <348A99DA5F5B7549AA880327E580B4358973BCD1@IRSMSX101.ger.corp.intel.com> Accept-Language: en-GB, 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.180] 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: <20190410162133.Sn8larzOHVp4HfbRUZS3dLoGzgTiHjEnyE2zcEhJxyY@z> Hi Fiona, > > Subject: RE: [PATCH] crypto/qat: fix segmentation fault in QAT PMD > > > > Hi Bernard, > > > > > > > > While running the IPsec unit test program the following segmentation > > > fault is occurring: > > > > > > 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)) { > > > > > > Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op > > > oriented") > > > Signed-off-by: Bernard Iremonger > > > --- > > > drivers/crypto/qat/qat_sym.c | 6 ++++++ > > > 1 file changed, 6 insertions(+) > > > > > > 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; > > > > > > + 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[] contain valid crypto-ops (as in majority of other data-path funct= ions). > > Suppose the main question here - why ipsec UT passes NULL as crypto-op > here? > > Konstantin > [Fiona] Agree with Konstantin - it's the data-path - we expect a valid op= ptr. > Can the real issue be related to the recent addition of asymmetric QAT PM= D? > Not all QAT PMDs support symmetric crypto now. > Is IPSec unit test finding a QAT asymm PMD and not checking it's capabili= ties > or checking but not handling the result well and following a path that pa= sses a > NULL op to it? Self NAK, issue found in test_ipsec code. Regards, Bernard.