From: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
To: john.mcnamara@intel.com
Cc: dev@dpdk.org, Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>,
ian.betts@intel.com, stable@dpdk.org
Subject: [dpdk-stable] [PATCH] examples/performance-thread: fix out-of-bounds read
Date: Wed, 20 Sep 2017 10:05:37 +0200 [thread overview]
Message-ID: <1505894737-25596-1-git-send-email-slawomirx.mrozowicz@intel.com> (raw)
Overrunning array schedcore of 128 8-byte elements at element index 128
using index lcoreid.
Fixed by correct check index lcoreid condition.
Coverity issue: 143461
Fixes: 116819b9ed0d ("examples/performance-thread: add lthread subsystem")
Cc: ian.betts@intel.com
Cc: stable@dpdk.org
Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
---
examples/performance-thread/common/lthread_sched.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/examples/performance-thread/common/lthread_sched.c b/examples/performance-thread/common/lthread_sched.c
index 98291478e..138a87d32 100644
--- a/examples/performance-thread/common/lthread_sched.c
+++ b/examples/performance-thread/common/lthread_sched.c
@@ -578,10 +578,9 @@ int lthread_set_affinity(unsigned lcoreid)
struct lthread *lt = THIS_LTHREAD;
struct lthread_sched *dest_sched;
- if (unlikely(lcoreid > LTHREAD_MAX_LCORES))
+ if (unlikely(lcoreid >= LTHREAD_MAX_LCORES))
return POSIX_ERRNO(EINVAL);
-
DIAG_EVENT(lt, LT_DIAG_LTHREAD_AFFINITY, lcoreid, 0);
dest_sched = schedcore[lcoreid];
--
2.11.0
next reply other threads:[~2017-09-20 8:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-20 8:05 Slawomir Mrozowicz [this message]
2017-10-11 13:55 ` [dpdk-stable] [dpdk-dev] " Jastrzebski, MichalX K
-- strict thread matches above, loose matches on Subject: below --
2017-09-20 8:21 [dpdk-stable] " Slawomir Mrozowicz
2017-09-20 8:20 Slawomir Mrozowicz
2017-09-20 7:47 Slawomir Mrozowicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1505894737-25596-1-git-send-email-slawomirx.mrozowicz@intel.com \
--to=slawomirx.mrozowicz@intel.com \
--cc=dev@dpdk.org \
--cc=ian.betts@intel.com \
--cc=john.mcnamara@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).