[dpdk-dev] [PATCH] examples/performance-thread: fix out-of-bounds read

Jastrzebski, MichalX K michalx.k.jastrzebski at intel.com
Wed Oct 11 15:56:06 CEST 2017


> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Slawomir
> Mrozowicz
> Sent: Wednesday, September 20, 2017 10:20 AM
> To: Mcnamara, John <john.mcnamara at intel.com>
> Cc: dev at dpdk.org; Mrozowicz, SlawomirX
> <slawomirx.mrozowicz at intel.com>; ian.betts at intel.com; stable at 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 at intel.com
> Cc: stable at dpdk.org
> 
> Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz at 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 at intel.com>


More information about the dev mailing list