Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1216949 > unrolled thread

[GIT PULL 0/3] perf/urgent fixes

Started byArnaldo Carvalho de Melo <acme@kernel.org>
First post2015-09-01 18:20 +0200
Last post2015-09-02 09:30 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-09-01 18:20 +0200
    [PATCH 1/3] perf dwarf: Fix potential array out of bounds access Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-09-01 18:20 +0200
    Re: [GIT PULL 0/3] perf/urgent fixes Ingo Molnar <mingo@kernel.org> - 2015-09-02 09:30 +0200

#1216949 — [GIT PULL 0/3] perf/urgent fixes

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2015-09-01 18:20 +0200
Subject[GIT PULL 0/3] perf/urgent fixes
Message-ID<q3WrU-3db-5@gated-at.bofh.it>
Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 532026612455a4a6fd27c1b2e7111263f63218a2:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2015-09-01 10:25:57 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo

for you to fetch changes up to af4aeadd8c04303c0aa2d112145c3627e2ebd026:

  perf tools: Fix link time error with sample_reg_masks on non x86 (2015-09-01 13:04:41 -0300)

----------------------------------------------------------------
perf/urgent fixes:

- Fix link time error with sample_reg_masks on non x86 (Stephane Eranian)

- Fix potential array out of bounds access (Wang Nan)

- Fix Intel PT instruction decoder dependency problem (Wang Nan)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Stephane Eranian (1):
      perf tools: Fix link time error with sample_reg_masks on non x86

Wang Nan (2):
      perf dwarf: Fix potential array out of bounds access
      perf build: Fix Intel PT instruction decoder dependency problem

 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 +-
 tools/perf/arch/x86/util/perf_regs.c    | 44 ++++++++++++++++-----------------
 tools/perf/util/intel-pt-decoder/Build  |  1 +
 tools/perf/util/perf_regs.c             |  4 +++
 tools/perf/util/perf_regs.h             |  2 ++
 7 files changed, 31 insertions(+), 26 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1216951 — [PATCH 1/3] perf dwarf: Fix potential array out of bounds access

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2015-09-01 18:20 +0200
Subject[PATCH 1/3] perf dwarf: Fix potential array out of bounds access
Message-ID<q3WrV-3db-25@gated-at.bofh.it>
In reply to#1216949
From: Wang Nan <wangnan0@huawei.com>

There is a problem in the dwarf-regs.c files for sh, sparc and x86 where
it is possible to make an out-of-bounds array access when searching for
register names.

This patch fixes it by replacing '<=' to '<', so when register (number
== XXX_MAX_REGS), get_arch_regstr() will return NULL.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Reviewed-by: Matt Fleming <matt@console-pimps.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@huawei.com
Link: http://lkml.kernel.org/r/1441078184-105038-1-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 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(-)

diff --git a/tools/perf/arch/sh/util/dwarf-regs.c b/tools/perf/arch/sh/util/dwarf-regs.c
index 0d0897f57a10..f8dfa89696f4 100644
--- a/tools/perf/arch/sh/util/dwarf-regs.c
+++ b/tools/perf/arch/sh/util/dwarf-regs.c
@@ -51,5 +51,5 @@ const char *sh_regs_table[SH_MAX_REGS] = {
 /* Return architecture dependent register string (for kprobe-tracer) */
 const char *get_arch_regstr(unsigned int n)
 {
-	return (n <= SH_MAX_REGS) ? sh_regs_table[n] : NULL;
+	return (n < SH_MAX_REGS) ? sh_regs_table[n] : NULL;
 }
diff --git a/tools/perf/arch/sparc/util/dwarf-regs.c b/tools/perf/arch/sparc/util/dwarf-regs.c
index 92eda412fed3..b704fdb9237a 100644
--- a/tools/perf/arch/sparc/util/dwarf-regs.c
+++ b/tools/perf/arch/sparc/util/dwarf-regs.c
@@ -39,5 +39,5 @@ const char *sparc_regs_table[SPARC_MAX_REGS] = {
  */
 const char *get_arch_regstr(unsigned int n)
 {
-	return (n <= SPARC_MAX_REGS) ? sparc_regs_table[n] : NULL;
+	return (n < SPARC_MAX_REGS) ? sparc_regs_table[n] : NULL;
 }
diff --git a/tools/perf/arch/x86/util/dwarf-regs.c b/tools/perf/arch/x86/util/dwarf-regs.c
index be22dd463232..a08de0a35b83 100644
--- a/tools/perf/arch/x86/util/dwarf-regs.c
+++ b/tools/perf/arch/x86/util/dwarf-regs.c
@@ -71,5 +71,5 @@ const char *x86_64_regs_table[X86_64_MAX_REGS] = {
 /* Return architecture dependent register string (for kprobe-tracer) */
 const char *get_arch_regstr(unsigned int n)
 {
-	return (n <= ARCH_MAX_REGS) ? arch_regs_table[n] : NULL;
+	return (n < ARCH_MAX_REGS) ? arch_regs_table[n] : NULL;
 }
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1217371

FromIngo Molnar <mingo@kernel.org>
Date2015-09-02 09:30 +0200
Message-ID<q4aEz-6H0-19@gated-at.bofh.it>
In reply to#1216949
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 532026612455a4a6fd27c1b2e7111263f63218a2:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2015-09-01 10:25:57 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo
> 
> for you to fetch changes up to af4aeadd8c04303c0aa2d112145c3627e2ebd026:
> 
>   perf tools: Fix link time error with sample_reg_masks on non x86 (2015-09-01 13:04:41 -0300)
> 
> ----------------------------------------------------------------
> perf/urgent fixes:
> 
> - Fix link time error with sample_reg_masks on non x86 (Stephane Eranian)
> 
> - Fix potential array out of bounds access (Wang Nan)
> 
> - Fix Intel PT instruction decoder dependency problem (Wang Nan)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Stephane Eranian (1):
>       perf tools: Fix link time error with sample_reg_masks on non x86
> 
> Wang Nan (2):
>       perf dwarf: Fix potential array out of bounds access
>       perf build: Fix Intel PT instruction decoder dependency problem
> 
>  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 +-
>  tools/perf/arch/x86/util/perf_regs.c    | 44 ++++++++++++++++-----------------
>  tools/perf/util/intel-pt-decoder/Build  |  1 +
>  tools/perf/util/perf_regs.c             |  4 +++
>  tools/perf/util/perf_regs.h             |  2 ++
>  7 files changed, 31 insertions(+), 26 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web