DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/performance-thread: fix out-of-bounds read
@ 2017-09-20  8:20 Slawomir Mrozowicz
  2017-10-11 13:56 ` Jastrzebski, MichalX K
  0 siblings, 1 reply; 3+ messages in thread
From: Slawomir Mrozowicz @ 2017-09-20  8:20 UTC (permalink / raw)
  To: john.mcnamara; +Cc: dev, Slawomir Mrozowicz, ian.betts, stable

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 <slawomirx.mrozowicz@intel.com>
---
 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/performance-thread: fix out-of-bounds read
  2017-09-20  8:20 [dpdk-dev] [PATCH] examples/performance-thread: fix out-of-bounds read Slawomir Mrozowicz
@ 2017-10-11 13:56 ` Jastrzebski, MichalX K
  2017-10-13 23:23   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Jastrzebski, MichalX K @ 2017-10-11 13:56 UTC (permalink / raw)
  To: Mrozowicz, SlawomirX, Mcnamara, John
  Cc: dev, Mrozowicz, SlawomirX, ian.betts, stable

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Slawomir
> Mrozowicz
> Sent: Wednesday, September 20, 2017 10:20 AM
> To: Mcnamara, John <john.mcnamara@intel.com>
> Cc: dev@dpdk.org; Mrozowicz, SlawomirX
> <slawomirx.mrozowicz@intel.com>; ian.betts@intel.com; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] examples/performance-thread: fix out-of-
> bounds read
> 
> 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 <slawomirx.mrozowicz@intel.com>
> ---
>  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

Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [dpdk-stable] [PATCH] examples/performance-thread: fix out-of-bounds read
  2017-10-11 13:56 ` Jastrzebski, MichalX K
@ 2017-10-13 23:23   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2017-10-13 23:23 UTC (permalink / raw)
  To: Mrozowicz, SlawomirX
  Cc: Jastrzebski, MichalX K, Mcnamara, John, dev, ian.betts

> > 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 <slawomirx.mrozowicz@intel.com>
> 
> Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-13 23:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-20  8:20 [dpdk-dev] [PATCH] examples/performance-thread: fix out-of-bounds read Slawomir Mrozowicz
2017-10-11 13:56 ` Jastrzebski, MichalX K
2017-10-13 23:23   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

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).