mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] perf tools: Fix segfault due to invalid kernel dso access
@ 2014-11-18  4:30 Namhyung Kim
  2014-11-20  6:44 ` Namhyung Kim
  2014-12-08  6:49 ` [tip:perf/core] " tip-bot for Namhyung Kim
  0 siblings, 2 replies; 4+ messages in thread
From: Namhyung Kim @ 2014-11-18  4:30 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Ingo Molnar, Paul Mackerras, Namhyung Kim,
	Namhyung Kim, LKML, David Ahern, Adrian Hunter, Jiri Olsa

Jiri reported that the commit 96d78059d6d9 ("perf tools: Make vmlinux
short name more like kallsyms short name") segfaults on perf script.

When processing kernel mmap event, it should access the 'kernel'
variable as sometimes it cannot find a matching dso from build-id
table so 'dso' might be invalid.

Reported-by: Jiri Olsa <jolsa@redhat.com>
Tested-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/machine.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 52e94902afb1..85033d80fd6a 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1106,8 +1106,8 @@ static int machine__process_kernel_mmap_event(struct machine *machine,
 		if (__machine__create_kernel_maps(machine, kernel) < 0)
 			goto out_problem;
 
-		if (strstr(dso->long_name, "vmlinux"))
-			dso__set_short_name(dso, "[kernel.vmlinux]", false);
+		if (strstr(kernel->long_name, "vmlinux"))
+			dso__set_short_name(kernel, "[kernel.vmlinux]", false);
 
 		machine__set_kernel_mmap_len(machine, event);
 
-- 
2.1.2


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

* Re: [PATCH] perf tools: Fix segfault due to invalid kernel dso access
  2014-11-18  4:30 [PATCH] perf tools: Fix segfault due to invalid kernel dso access Namhyung Kim
@ 2014-11-20  6:44 ` Namhyung Kim
  2014-11-20 20:52   ` Arnaldo Carvalho de Melo
  2014-12-08  6:49 ` [tip:perf/core] " tip-bot for Namhyung Kim
  1 sibling, 1 reply; 4+ messages in thread
From: Namhyung Kim @ 2014-11-20  6:44 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Ingo Molnar, Paul Mackerras, Namhyung Kim, LKML,
	David Ahern, Adrian Hunter, Jiri Olsa

Arnaldo,

Could you please consider applying this?

Thanks,
Namhyung


On Tue, 18 Nov 2014 13:30:28 +0900, Namhyung Kim wrote:
> Jiri reported that the commit 96d78059d6d9 ("perf tools: Make vmlinux
> short name more like kallsyms short name") segfaults on perf script.
>
> When processing kernel mmap event, it should access the 'kernel'
> variable as sometimes it cannot find a matching dso from build-id
> table so 'dso' might be invalid.
>
> Reported-by: Jiri Olsa <jolsa@redhat.com>
> Tested-by: Jiri Olsa <jolsa@redhat.com>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/perf/util/machine.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
> index 52e94902afb1..85033d80fd6a 100644
> --- a/tools/perf/util/machine.c
> +++ b/tools/perf/util/machine.c
> @@ -1106,8 +1106,8 @@ static int machine__process_kernel_mmap_event(struct machine *machine,
>  		if (__machine__create_kernel_maps(machine, kernel) < 0)
>  			goto out_problem;
>  
> -		if (strstr(dso->long_name, "vmlinux"))
> -			dso__set_short_name(dso, "[kernel.vmlinux]", false);
> +		if (strstr(kernel->long_name, "vmlinux"))
> +			dso__set_short_name(kernel, "[kernel.vmlinux]", false);
>  
>  		machine__set_kernel_mmap_len(machine, event);

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

* Re: [PATCH] perf tools: Fix segfault due to invalid kernel dso access
  2014-11-20  6:44 ` Namhyung Kim
@ 2014-11-20 20:52   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-11-20 20:52 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Peter Zijlstra, Ingo Molnar, Paul Mackerras, Namhyung Kim, LKML,
	David Ahern, Adrian Hunter, Jiri Olsa

Em Thu, Nov 20, 2014 at 03:44:36PM +0900, Namhyung Kim escreveu:
> Arnaldo,
> 
> Could you please consider applying this?

Right, I should've added this to the previous pull req, will be on the
next.

- Arnaldo
 
> Thanks,
> Namhyung
> 
> 
> On Tue, 18 Nov 2014 13:30:28 +0900, Namhyung Kim wrote:
> > Jiri reported that the commit 96d78059d6d9 ("perf tools: Make vmlinux
> > short name more like kallsyms short name") segfaults on perf script.
> >
> > When processing kernel mmap event, it should access the 'kernel'
> > variable as sometimes it cannot find a matching dso from build-id
> > table so 'dso' might be invalid.
> >
> > Reported-by: Jiri Olsa <jolsa@redhat.com>
> > Tested-by: Jiri Olsa <jolsa@redhat.com>
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> > ---
> >  tools/perf/util/machine.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
> > index 52e94902afb1..85033d80fd6a 100644
> > --- a/tools/perf/util/machine.c
> > +++ b/tools/perf/util/machine.c
> > @@ -1106,8 +1106,8 @@ static int machine__process_kernel_mmap_event(struct machine *machine,
> >  		if (__machine__create_kernel_maps(machine, kernel) < 0)
> >  			goto out_problem;
> >  
> > -		if (strstr(dso->long_name, "vmlinux"))
> > -			dso__set_short_name(dso, "[kernel.vmlinux]", false);
> > +		if (strstr(kernel->long_name, "vmlinux"))
> > +			dso__set_short_name(kernel, "[kernel.vmlinux]", false);
> >  
> >  		machine__set_kernel_mmap_len(machine, event);

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

* [tip:perf/core] perf tools: Fix segfault due to invalid kernel dso access
  2014-11-18  4:30 [PATCH] perf tools: Fix segfault due to invalid kernel dso access Namhyung Kim
  2014-11-20  6:44 ` Namhyung Kim
@ 2014-12-08  6:49 ` tip-bot for Namhyung Kim
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Namhyung Kim @ 2014-12-08  6:49 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, dsahern, hpa, adrian.hunter, tglx, mingo, namhyung,
	jolsa, namhyung.kim, acme, paulus, a.p.zijlstra

Commit-ID:  330dfa224fcc8594977785a6493ca06d124f0cfe
Gitweb:     http://git.kernel.org/tip/330dfa224fcc8594977785a6493ca06d124f0cfe
Author:     Namhyung Kim <namhyung@kernel.org>
AuthorDate: Tue, 18 Nov 2014 13:30:28 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 24 Nov 2014 18:03:48 -0300

perf tools: Fix segfault due to invalid kernel dso access

Jiri reported that the commit 96d78059d6d9 ("perf tools: Make vmlinux
short name more like kallsyms short name") segfaults on perf script.

When processing kernel mmap event, it should access the 'kernel'
variable as sometimes it cannot find a matching dso from build-id table
so 'dso' might be invalid.

Reported-by: Jiri Olsa <jolsa@redhat.com>
Tested-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1416285028-30572-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/machine.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index d97309c..b75b487 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1106,8 +1106,8 @@ static int machine__process_kernel_mmap_event(struct machine *machine,
 		if (__machine__create_kernel_maps(machine, kernel) < 0)
 			goto out_problem;
 
-		if (strstr(dso->long_name, "vmlinux"))
-			dso__set_short_name(dso, "[kernel.vmlinux]", false);
+		if (strstr(kernel->long_name, "vmlinux"))
+			dso__set_short_name(kernel, "[kernel.vmlinux]", false);
 
 		machine__set_kernel_mmap_len(machine, event);
 

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

end of thread, other threads:[~2014-12-08  6:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-18  4:30 [PATCH] perf tools: Fix segfault due to invalid kernel dso access Namhyung Kim
2014-11-20  6:44 ` Namhyung Kim
2014-11-20 20:52   ` Arnaldo Carvalho de Melo
2014-12-08  6:49 ` [tip:perf/core] " tip-bot for Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome