Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5084EC55189 for ; Wed, 22 Apr 2020 23:52:16 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 1AB692076E for ; Wed, 22 Apr 2020 23:52:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AB692076E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6FE2B1D405; Thu, 23 Apr 2020 01:52:15 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id A08BA1C2F9 for ; Thu, 23 Apr 2020 01:52:13 +0200 (CEST) IronPort-SDR: ZtFVn3lh6vgAidj7Y5c2gH6L1alV1xW886ZPQUZ9TxiGrDD2K94By2lTH6qtKa9pqdIw1AWjXf /KTeCiZsH7Yg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2020 16:52:12 -0700 IronPort-SDR: FpklowXa+IWXBBauhbJqmQNOp1r6h62IUsoBwf26c1NFEfKds4Q3mDYyghpLV25JKwaxhaqqS2 RNxMRNF4c9DQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,304,1583222400"; d="scan'208";a="246109728" Received: from sivswdev08.ir.intel.com ([10.237.217.47]) by fmsmga007.fm.intel.com with ESMTP; 22 Apr 2020 16:52:11 -0700 From: Konstantin Ananyev To: dev@dpdk.org Cc: akhil.goyal@nxp.com, declan.doherty@intel.com, Konstantin Ananyev Date: Thu, 23 Apr 2020 00:51:58 +0100 Message-Id: <20200422235158.24497-1-konstantin.ananyev@intel.com> X-Mailer: git-send-email 2.18.0 Subject: [dpdk-dev] [PATCH] security: fix crash at accessing non-implemented ops 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" Valid checks for optional function pointers inside dev-ops were disabled by undefined macro. Fixes: b6ee98547847 ("security: fix verification of parameters") Signed-off-by: Konstantin Ananyev --- lib/librte_security/rte_security.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/librte_security/rte_security.c b/lib/librte_security/rte_security.c index d475b0977..b65430ce2 100644 --- a/lib/librte_security/rte_security.c +++ b/lib/librte_security/rte_security.c @@ -107,11 +107,9 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance, struct rte_security_session *sess, struct rte_mbuf *m, void *params) { -#ifdef RTE_DEBUG RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, set_pkt_metadata, -EINVAL, -ENOTSUP); RTE_PTR_OR_ERR_RET(sess, -EINVAL); -#endif return instance->ops->set_pkt_metadata(instance->device, sess, m, params); } @@ -121,9 +119,7 @@ rte_security_get_userdata(struct rte_security_ctx *instance, uint64_t md) { void *userdata = NULL; -#ifdef RTE_DEBUG RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, get_userdata, NULL, NULL); -#endif if (instance->ops->get_userdata(instance->device, md, &userdata)) return NULL; -- 2.17.1