From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id CB4ABA51 for ; Mon, 16 Jul 2018 18:04:20 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jul 2018 09:04:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,361,1526367600"; d="scan'208";a="245674842" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga005.fm.intel.com with ESMTP; 16 Jul 2018 09:04:19 -0700 Received: from irsmsx156.ger.corp.intel.com (10.108.20.68) by IRSMSX104.ger.corp.intel.com (163.33.3.159) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 16 Jul 2018 17:04:18 +0100 Received: from irsmsx107.ger.corp.intel.com ([169.254.10.193]) by IRSMSX156.ger.corp.intel.com ([169.254.3.205]) with mapi id 14.03.0319.002; Mon, 16 Jul 2018 17:04:18 +0100 From: "Dumitrescu, Cristian" To: "Singh, Jasvinder" , "dev@dpdk.org" Thread-Topic: [PATCH] net/softnic: fix illegal memory access Thread-Index: AQHUHQJhFmVKwOPoGEGgJ7GUf/BhQaSSAu0w Date: Mon, 16 Jul 2018 16:04:16 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D891268E77452D@IRSMSX107.ger.corp.intel.com> References: <20180716124147.89863-1-jasvinder.singh@intel.com> In-Reply-To: <20180716124147.89863-1-jasvinder.singh@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/softnic: fix illegal memory access 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, 16 Jul 2018 16:04:21 -0000 > -----Original Message----- > From: Singh, Jasvinder > Sent: Monday, July 16, 2018 1:42 PM > To: dev@dpdk.org > Cc: Dumitrescu, Cristian > Subject: [PATCH] net/softnic: fix illegal memory access >=20 > Fix pointer dereferencing and read after free (USE_AFTER_FREE). >=20 > Coverity issue: 302867 > Fixes: bef50bcb1c47 ("net/softnic: implement start and stop") >=20 > Signed-off-by: Jasvinder Singh > --- > drivers/net/softnic/rte_eth_softnic_swq.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/softnic/rte_eth_softnic_swq.c > b/drivers/net/softnic/rte_eth_softnic_swq.c > index 1944fbb..604a2cc 100644 > --- a/drivers/net/softnic/rte_eth_softnic_swq.c > +++ b/drivers/net/softnic/rte_eth_softnic_swq.c > @@ -36,9 +36,13 @@ softnic_swq_free(struct pmd_internals *p) > void > softnic_softnic_swq_free_keep_rxq_txq(struct pmd_internals *p) > { > - struct softnic_swq *swq; > + for ( ; ; ) { > + struct softnic_swq *swq; > + > + swq =3D TAILQ_FIRST(&p->swq_list); > + if (swq =3D=3D NULL) > + break; >=20 > - TAILQ_FOREACH(swq, &p->swq_list, node) { > if ((strncmp(swq->name, "RXQ", strlen("RXQ")) =3D=3D 0) || > (strncmp(swq->name, "TXQ", strlen("TXQ")) =3D=3D 0)) > continue; > -- > 2.9.3 Where is the bug? We simply parse a linked list to free each element.