* [dpdk-dev] [PATCH] examples/performance-thread: fix out-of-bounds read
@ 2017-09-20 8:21 Slawomir Mrozowicz
2017-10-11 13:56 ` Jastrzebski, MichalX K
0 siblings, 1 reply; 12+ messages in thread
From: Slawomir Mrozowicz @ 2017-09-20 8:21 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: 143463
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 | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
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 = NULL;
- if (k > LTHREAD_MAX_KEYS)
- return NULL;
+ if (k < LTHREAD_MAX_KEYS)
+ res = THIS_LTHREAD->tls->data[k];
- return THIS_LTHREAD->tls->data[k];
+ return res;
}
/*
--
2.11.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/performance-thread: fix out-of-bounds read
2017-09-20 8:21 [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 ` Thomas Monjalon
0 siblings, 1 reply; 12+ 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:21 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: 143463
> 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 | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> 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 = NULL;
>
> - if (k > LTHREAD_MAX_KEYS)
> - return NULL;
> + if (k < LTHREAD_MAX_KEYS)
> + res = THIS_LTHREAD->tls->data[k];
>
> - return THIS_LTHREAD->tls->data[k];
> + return res;
> }
>
> /*
> --
> 2.11.0
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [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; 12+ messages in thread
From: Thomas Monjalon @ 2017-10-13 23:23 UTC (permalink / raw)
To: Mrozowicz, SlawomirX
Cc: dev, Jastrzebski, MichalX K, Mcnamara, John, 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: 143463
> > 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] 12+ messages in thread
* [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; 12+ 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] 12+ messages in thread
* Re: [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, 0 replies; 12+ 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] 12+ messages in thread
* [dpdk-dev] [PATCH] examples/performance-thread: fix out-of-bounds read
@ 2017-09-20 8:05 Slawomir Mrozowicz
2017-10-11 13:55 ` Jastrzebski, MichalX K
0 siblings, 1 reply; 12+ messages in thread
From: Slawomir Mrozowicz @ 2017-09-20 8:05 UTC (permalink / raw)
To: john.mcnamara; +Cc: dev, Slawomir Mrozowicz, ian.betts, stable
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/performance-thread: fix out-of-bounds read
2017-09-20 8:05 Slawomir Mrozowicz
@ 2017-10-11 13:55 ` Jastrzebski, MichalX K
2017-10-13 23:19 ` Thomas Monjalon
0 siblings, 1 reply; 12+ messages in thread
From: Jastrzebski, MichalX K @ 2017-10-11 13:55 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:06 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 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
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/performance-thread: fix out-of-bounds read
2017-10-11 13:55 ` Jastrzebski, MichalX K
@ 2017-10-13 23:19 ` Thomas Monjalon
0 siblings, 0 replies; 12+ messages in thread
From: Thomas Monjalon @ 2017-10-13 23:19 UTC (permalink / raw)
To: Mrozowicz, SlawomirX
Cc: dev, Jastrzebski, MichalX K, Mcnamara, John, ian.betts
> > 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>
>
> Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Applied, thanks
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH] examples/performance-thread: fix out-of-bounds read
@ 2017-09-20 7:47 Slawomir Mrozowicz
2017-10-02 14:07 ` Jastrzebski, MichalX K
0 siblings, 1 reply; 12+ messages in thread
From: Slawomir Mrozowicz @ 2017-09-20 7:47 UTC (permalink / raw)
To: john.mcnamara; +Cc: dev, Slawomir Mrozowicz, ian.betts, stable
Overrunning array schedcore of 128 8-byte elements at element index 128
using index lcore_id.
Fixed by correct check index lcoreid condition and
change type of lcoreid to unsigned.
Coverity issue: 143459
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.h | 2 +-
examples/performance-thread/common/lthread_sched.c | 11 +++++++----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/examples/performance-thread/common/lthread.h b/examples/performance-thread/common/lthread.h
index 5c2c1a5f0..0cde5919b 100644
--- a/examples/performance-thread/common/lthread.h
+++ b/examples/performance-thread/common/lthread.h
@@ -87,7 +87,7 @@ int _lthread_desched_sleep(struct lthread *lt);
void _lthread_free(struct lthread *lt);
-struct lthread_sched *_lthread_sched_get(int lcore_id);
+struct lthread_sched *_lthread_sched_get(unsigned int lcore_id);
struct lthread_stack *_stack_alloc(void);
diff --git a/examples/performance-thread/common/lthread_sched.c b/examples/performance-thread/common/lthread_sched.c
index 98291478e..3484387b4 100644
--- a/examples/performance-thread/common/lthread_sched.c
+++ b/examples/performance-thread/common/lthread_sched.c
@@ -562,11 +562,14 @@ void lthread_run(void)
* Return the scheduler for this lcore
*
*/
-struct lthread_sched *_lthread_sched_get(int lcore_id)
+struct lthread_sched *_lthread_sched_get(unsigned int lcore_id)
{
- if (lcore_id > LTHREAD_MAX_LCORES)
- return NULL;
- return schedcore[lcore_id];
+ struct lthread_sched *res = NULL;
+
+ if (lcore_id < LTHREAD_MAX_LCORES)
+ res = schedcore[lcore_id];
+
+ return res;
}
/*
--
2.11.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/performance-thread: fix out-of-bounds read
2017-09-20 7:47 Slawomir Mrozowicz
@ 2017-10-02 14:07 ` Jastrzebski, MichalX K
2017-10-11 13:55 ` Jastrzebski, MichalX K
0 siblings, 1 reply; 12+ messages in thread
From: Jastrzebski, MichalX K @ 2017-10-02 14:07 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 9:48 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 schedcore of 128 8-byte elements at element index 128
> using index lcore_id.
> Fixed by correct check index lcoreid condition and
> change type of lcoreid to unsigned.
>
> Coverity issue: 143459
> 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.h | 2 +-
> examples/performance-thread/common/lthread_sched.c | 11 +++++++----
> 2 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/examples/performance-thread/common/lthread.h
> b/examples/performance-thread/common/lthread.h
> index 5c2c1a5f0..0cde5919b 100644
> --- a/examples/performance-thread/common/lthread.h
> +++ b/examples/performance-thread/common/lthread.h
> @@ -87,7 +87,7 @@ int _lthread_desched_sleep(struct lthread *lt);
>
> void _lthread_free(struct lthread *lt);
>
> -struct lthread_sched *_lthread_sched_get(int lcore_id);
> +struct lthread_sched *_lthread_sched_get(unsigned int lcore_id);
>
> struct lthread_stack *_stack_alloc(void);
>
> diff --git a/examples/performance-thread/common/lthread_sched.c
> b/examples/performance-thread/common/lthread_sched.c
> index 98291478e..3484387b4 100644
> --- a/examples/performance-thread/common/lthread_sched.c
> +++ b/examples/performance-thread/common/lthread_sched.c
> @@ -562,11 +562,14 @@ void lthread_run(void)
> * Return the scheduler for this lcore
> *
> */
> -struct lthread_sched *_lthread_sched_get(int lcore_id)
> +struct lthread_sched *_lthread_sched_get(unsigned int lcore_id)
> {
> - if (lcore_id > LTHREAD_MAX_LCORES)
> - return NULL;
> - return schedcore[lcore_id];
> + struct lthread_sched *res = NULL;
> +
> + if (lcore_id < LTHREAD_MAX_LCORES)
> + res = schedcore[lcore_id];
> +
> + return res;
> }
>
> /*
> --
> 2.11.0
Hi John,
Here are four fixes for coverity issues in lthread code:
http://dpdk.org/dev/patchwork/patch/28979/
http://dpdk.org/dev/patchwork/patch/28977/
http://dpdk.org/dev/patchwork/patch/28976/
http://dpdk.org/dev/patchwork/patch/28975/
I would like to ask for Your feedback about these fix proposals.
If everything is ok with them, please send acked-by.
Best regards
Michal.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/performance-thread: fix out-of-bounds read
2017-10-02 14:07 ` Jastrzebski, MichalX K
@ 2017-10-11 13:55 ` Jastrzebski, MichalX K
2017-10-13 23:14 ` Thomas Monjalon
0 siblings, 1 reply; 12+ messages in thread
From: Jastrzebski, MichalX K @ 2017-10-11 13:55 UTC (permalink / raw)
To: Jastrzebski, MichalX K, Mrozowicz, SlawomirX, Mcnamara, John
Cc: dev, Mrozowicz, SlawomirX, ian.betts, stable
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jastrzebski,
> MichalX K
> Sent: Monday, October 2, 2017 4:08 PM
> To: Mrozowicz, SlawomirX <slawomirx.mrozowicz@intel.com>; Mcnamara,
> John <john.mcnamara@intel.com>
> Cc: dev@dpdk.org; Mrozowicz, SlawomirX
> <slawomirx.mrozowicz@intel.com>; ian.betts@intel.com; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] examples/performance-thread: fix out-of-
> bounds read
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Slawomir
> > Mrozowicz
> > Sent: Wednesday, September 20, 2017 9:48 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 schedcore of 128 8-byte elements at element index
> 128
> > using index lcore_id.
> > Fixed by correct check index lcoreid condition and
> > change type of lcoreid to unsigned.
> >
> > Coverity issue: 143459
> > 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.h | 2 +-
> > examples/performance-thread/common/lthread_sched.c | 11 +++++++--
> --
> > 2 files changed, 8 insertions(+), 5 deletions(-)
> >
> > diff --git a/examples/performance-thread/common/lthread.h
> > b/examples/performance-thread/common/lthread.h
> > index 5c2c1a5f0..0cde5919b 100644
> > --- a/examples/performance-thread/common/lthread.h
> > +++ b/examples/performance-thread/common/lthread.h
> > @@ -87,7 +87,7 @@ int _lthread_desched_sleep(struct lthread *lt);
> >
> > void _lthread_free(struct lthread *lt);
> >
> > -struct lthread_sched *_lthread_sched_get(int lcore_id);
> > +struct lthread_sched *_lthread_sched_get(unsigned int lcore_id);
> >
> > struct lthread_stack *_stack_alloc(void);
> >
> > diff --git a/examples/performance-thread/common/lthread_sched.c
> > b/examples/performance-thread/common/lthread_sched.c
> > index 98291478e..3484387b4 100644
> > --- a/examples/performance-thread/common/lthread_sched.c
> > +++ b/examples/performance-thread/common/lthread_sched.c
> > @@ -562,11 +562,14 @@ void lthread_run(void)
> > * Return the scheduler for this lcore
> > *
> > */
> > -struct lthread_sched *_lthread_sched_get(int lcore_id)
> > +struct lthread_sched *_lthread_sched_get(unsigned int lcore_id)
> > {
> > - if (lcore_id > LTHREAD_MAX_LCORES)
> > - return NULL;
> > - return schedcore[lcore_id];
> > + struct lthread_sched *res = NULL;
> > +
> > + if (lcore_id < LTHREAD_MAX_LCORES)
> > + res = schedcore[lcore_id];
> > +
> > + return res;
> > }
> >
> > /*
> > --
> > 2.11.0
>
> Hi John,
> Here are four fixes for coverity issues in lthread code:
> http://dpdk.org/dev/patchwork/patch/28979/
> http://dpdk.org/dev/patchwork/patch/28977/
> http://dpdk.org/dev/patchwork/patch/28976/
> http://dpdk.org/dev/patchwork/patch/28975/
>
> I would like to ask for Your feedback about these fix proposals.
> If everything is ok with them, please send acked-by.
>
> Best regards
> Michal.
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/performance-thread: fix out-of-bounds read
2017-10-11 13:55 ` Jastrzebski, MichalX K
@ 2017-10-13 23:14 ` Thomas Monjalon
0 siblings, 0 replies; 12+ messages in thread
From: Thomas Monjalon @ 2017-10-13 23:14 UTC (permalink / raw)
To: Mrozowicz, SlawomirX
Cc: dev, Jastrzebski, MichalX K, Mcnamara, John, ian.betts
> > > Overrunning array schedcore of 128 8-byte elements at element index
> > 128
> > > using index lcore_id.
> > > Fixed by correct check index lcoreid condition and
> > > change type of lcoreid to unsigned.
> > >
> > > Coverity issue: 143459
> > > 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] 12+ messages in thread
end of thread, other threads:[~2017-10-13 23:23 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-20 8:21 [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 ` Thomas Monjalon
-- strict thread matches above, loose matches on Subject: below --
2017-09-20 8:20 Slawomir Mrozowicz
2017-10-11 13:56 ` Jastrzebski, MichalX K
2017-09-20 8:05 Slawomir Mrozowicz
2017-10-11 13:55 ` Jastrzebski, MichalX K
2017-10-13 23:19 ` Thomas Monjalon
2017-09-20 7:47 Slawomir Mrozowicz
2017-10-02 14:07 ` Jastrzebski, MichalX K
2017-10-11 13:55 ` Jastrzebski, MichalX K
2017-10-13 23:14 ` 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).