lkml.org 
[lkml]   [2015]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf tools: Fix potential array out of bounce accessing
On Tue, 01 Sep, at 03:29:44AM, Wang Nan wrote:
> There is a problem in dwarf-regs.c of sh, sparc and x86 that it is
> possible to make an out-of-bound array accessing when searching
> register names. This patch fixes it by replacing '<=' to '<', so when
> register (number == XXX_MAX_REGS), get_arch_regstr() returns NULL.
>
> Signed-off-by: Wang Nan <wangnan0@huawei.com>
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Matt Fleming <matt@console-pimps.org>
> Cc: Jiri Olsa <jolsa@kernel.org>
> ---
> tools/perf/arch/sh/util/dwarf-regs.c | 2 +-
> tools/perf/arch/sparc/util/dwarf-regs.c | 2 +-
> tools/perf/arch/x86/util/dwarf-regs.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)

Hmm, I wonder how that bug was introduced. I guess copy and paste is
probably to blame. Good catch.

Reviewed-by: Matt Fleming <matt.fleming@intel.com>

--
Matt Fleming, Intel Open Source Technology Center


\
 
 \ /
  Last update: 2015-09-01 11:01    [W:0.041 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site