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 A42C6A0096 for ; Mon, 8 Apr 2019 12:49:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6AB6E2C54; Mon, 8 Apr 2019 12:49:04 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 2BF742BD8 for ; Mon, 8 Apr 2019 12:49:03 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Apr 2019 03:49:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,325,1549958400"; d="scan'208";a="140895780" Received: from sivswdev08.ir.intel.com (HELO localhost.localdomain) ([10.237.217.47]) by orsmga003.jf.intel.com with ESMTP; 08 Apr 2019 03:49:00 -0700 From: Bernard Iremonger To: dev@dpdk.org, fiona.trahe@intel.com, konstantin.ananyev@intel.com, akhil.goyal@nxp.com Cc: Bernard Iremonger Date: Mon, 8 Apr 2019 11:48:57 +0100 Message-Id: <1554720537-14959-1-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190408104857.t81XUSzkPZLTw6xeHWRSxlmbXdIVByQVefd1YqhWTRU@z> 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=0x0, out_msg=0x100450580 "", op_cookie=0x101c6fd80, qat_dev_gen=QAT_GEN1) at /root/dpdk_ipsec_master-1/drivers/crypto/qat/qat_sym.c:165 165 if (unlikely(op->type != 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 = (struct qat_sym_op_cookie *)op_cookie; + if (op == NULL) { + QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto " + "operation requests, op (%p) is NULL", op); + return -EINVAL; + } + if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) { QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto " "operation requests, op (%p) is not a " -- 2.7.4