From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id CCFAC201; Wed, 20 Sep 2017 10:19:55 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2017 01:19:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,420,1500966000"; d="scan'208";a="1197089546" Received: from unknown (HELO Sent) ([10.103.102.77]) by fmsmga001.fm.intel.com with SMTP; 20 Sep 2017 01:19:50 -0700 Received: by Sent (sSMTP sendmail emulation); Wed, 20 Sep 2017 10:20:26 +0200 From: Slawomir Mrozowicz To: john.mcnamara@intel.com Cc: dev@dpdk.org, Slawomir Mrozowicz , ian.betts@intel.com, stable@dpdk.org Date: Wed, 20 Sep 2017 10:20:24 +0200 Message-Id: <1505895624-25734-1-git-send-email-slawomirx.mrozowicz@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [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, 20 Sep 2017 08:19:56 -0000 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. Coverity issue: 143462 Fixes: 116819b9ed0d ("examples/performance-thread: add lthread subsystem") Cc: ian.betts@intel.com Cc: stable@dpdk.org Signed-off-by: Slawomir Mrozowicz --- examples/performance-thread/common/lthread_tls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/performance-thread/common/lthread_tls.c b/examples/performance-thread/common/lthread_tls.c index 47505f2d4..58a9a8878 100644 --- a/examples/performance-thread/common/lthread_tls.c +++ b/examples/performance-thread/common/lthread_tls.c @@ -212,7 +212,7 @@ void */ int lthread_setspecific(unsigned int k, const void *data) { - if (k > LTHREAD_MAX_KEYS) + if (k >= LTHREAD_MAX_KEYS) return POSIX_ERRNO(EINVAL); int n = THIS_LTHREAD->tls->nb_keys_inuse; -- 2.11.0