From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 73B49A0471 for ; Mon, 15 Jul 2019 21:48:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0795C2C6A; Mon, 15 Jul 2019 21:48:13 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 9B6EF2C60 for ; Mon, 15 Jul 2019 21:48:11 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jul 2019 12:48:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,494,1557212400"; d="scan'208";a="161187874" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga008.jf.intel.com with ESMTP; 15 Jul 2019 12:48:10 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 15 Jul 2019 12:48:10 -0700 Received: from fmsmsx117.amr.corp.intel.com ([169.254.3.206]) by FMSMSX114.amr.corp.intel.com ([169.254.6.168]) with mapi id 14.03.0439.000; Mon, 15 Jul 2019 12:48:09 -0700 From: "Carrillo, Erik G" To: 'Stephen Hemminger' CC: "'thomas@monjalon.net'" , "'dev@dpdk.org'" Thread-Topic: [dpdk-dev] [PATCH 1/2] timer: fix null pointer dereference Thread-Index: AQHVOyON7FzSx+6Ovkut0ZzoYIKzHKbMSJ6A//+OPaCAADqeUA== Date: Mon, 15 Jul 2019 19:48:09 +0000 Message-ID: References: <1563205172-352-1-git-send-email-erik.g.carrillo@intel.com> <1563205172-352-2-git-send-email-erik.g.carrillo@intel.com> <20190715084841.4f6baebf@hermes.lan> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.1.200.107] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/2] timer: fix null pointer dereference 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" > -----Original Message----- > From: Carrillo, Erik G > Sent: Monday, July 15, 2019 11:04 AM > To: Stephen Hemminger > Cc: thomas@monjalon.net; dev@dpdk.org; stable@dpdk.org > Subject: RE: [dpdk-dev] [PATCH 1/2] timer: fix null pointer dereference >=20 > Hi Stephen, >=20 > > -----Original Message----- > > From: Stephen Hemminger > > Sent: Monday, July 15, 2019 10:49 AM > > To: Carrillo, Erik G > > Cc: thomas@monjalon.net; dev@dpdk.org; stable@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH 1/2] timer: fix null pointer > > dereference > > > > On Mon, 15 Jul 2019 10:39:31 -0500 > > Erik Gabriel Carrillo wrote: > > > > > If the timer subsystem is not initialized before rte_timer_manage > > > (for > > > example) is invoked, a pointer to a shared hugepage memory region > > > will still be null and dereferenced when it is checked for validity; > > > handle this case. > > > > > > Fixes: c0749f7096c7 ("timer: allow management in shared memory") > > > Cc: stable@dpdk.org > > > > > > Signed-off-by: Erik Gabriel Carrillo > > > > I have mixed feelings about this patch. > > Any calls to rte_timer before rte_timer_subsystem_init is not a valid u= sage. > > Better to kill the application. >=20 > Ok, that sounds like a better approach. I'll update the patch and resubm= it. >=20 I added a call to rte_exit() in the timer_data_valid() function for the cas= e where the library is uninitialized, but checkpatches.sh issues the follow= ing warning: "Warning in /lib/librte_timer/rte_timer.c: Using rte_panic/rte_exit" According to the comments in the script, we should refrain from new additio= ns of rte_panic() and rte_exit() in the lib subtree. In light of this, sh= ould we still proceed with this approach? It does seem like it would be us= eful. Thanks, Erik > Thanks, > Erik