From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id EF7E91B1A7; Wed, 11 Oct 2017 15:56:30 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2017 06:56:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,361,1503385200"; d="scan'208";a="161947945" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by fmsmga006.fm.intel.com with ESMTP; 11 Oct 2017 06:56:29 -0700 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.28]) by IRSMSX151.ger.corp.intel.com ([169.254.4.108]) with mapi id 14.03.0319.002; Wed, 11 Oct 2017 14:56:28 +0100 From: "Jastrzebski, MichalX K" To: "Mrozowicz, SlawomirX" , "Mcnamara, John" CC: "dev@dpdk.org" , "Mrozowicz, SlawomirX" , "ian.betts@intel.com" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] examples/performance-thread: fix out-of-bounds read Thread-Index: AQHTMeoFmAAetw7+i0SCjfIGm/CVPaLezZMQ Date: Wed, 11 Oct 2017 13:56:27 +0000 Message-ID: <60ABE07DBB3A454EB7FAD707B4BB158213C45814@IRSMSX109.ger.corp.intel.com> References: <1505895670-25808-1-git-send-email-slawomirx.mrozowicz@intel.com> In-Reply-To: <1505895670-25808-1-git-send-email-slawomirx.mrozowicz@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.0.116 dlp-reaction: no-action x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2JkNTgyOGYtMzk0ZS00MTNjLTg4YTAtNjRhNTM2ZmQ0Y2NhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlBBNjQxeWYxXC93QlZhYXA3NFlFb0N4cEFmV0N4b0hUQ2xpVDNLNFFuWktRPSJ9 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] examples/performance-thread: fix out-of-bounds read 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: Wed, 11 Oct 2017 13:56:31 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Slawomir > Mrozowicz > Sent: Wednesday, September 20, 2017 10:21 AM > To: Mcnamara, John > Cc: dev@dpdk.org; Mrozowicz, SlawomirX > ; ian.betts@intel.com; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] examples/performance-thread: fix out-of- > bounds read >=20 > Overrunning array per_lcore_this_sched->current_lthread->tls->data of > 1024 8-byte elements at element index 1024 using index k. > Fixed by correct check k condition. >=20 > Coverity issue: 143463 > Fixes: 116819b9ed0d ("examples/performance-thread: add lthread > subsystem") > Cc: ian.betts@intel.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Slawomir Mrozowicz > --- > examples/performance-thread/common/lthread_tls.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) >=20 > diff --git a/examples/performance-thread/common/lthread_tls.c > b/examples/performance-thread/common/lthread_tls.c > index 47505f2d4..4ae3c6c03 100644 > --- a/examples/performance-thread/common/lthread_tls.c > +++ b/examples/performance-thread/common/lthread_tls.c > @@ -198,11 +198,12 @@ void _lthread_tls_destroy(struct lthread *lt) > void > *lthread_getspecific(unsigned int k) > { > + void *res =3D NULL; >=20 > - if (k > LTHREAD_MAX_KEYS) > - return NULL; > + if (k < LTHREAD_MAX_KEYS) > + res =3D THIS_LTHREAD->tls->data[k]; >=20 > - return THIS_LTHREAD->tls->data[k]; > + return res; > } >=20 > /* > -- > 2.11.0 Acked-by: Michal Jastrzebski