Re: callchain map refcounting fixes was Re: [PATCH perf/core] perf script: fix a use after free crash.

2016-10-11 Thread Krister Johansen
On Sat, Oct 08, 2016 at 11:13:21PM -0700, Krister Johansen wrote: > On Fri, Oct 07, 2016 at 11:22:00AM +0900, Namhyung Kim wrote: > > On Wed, Oct 05, 2016 at 08:45:24AM -0300, Arnaldo Carvalho de Melo wrote: > > > Em Sat, Oct 01, 2016 at 08:13:36PM -0700, Krister Johansen escreveu: > > > > diff --g

Re: callchain map refcounting fixes was Re: [PATCH perf/core] perf script: fix a use after free crash.

2016-10-08 Thread Krister Johansen
Hi Namhyung, Thanks for looking this over. On Fri, Oct 07, 2016 at 11:22:00AM +0900, Namhyung Kim wrote: > On Wed, Oct 05, 2016 at 08:45:24AM -0300, Arnaldo Carvalho de Melo wrote: > > Em Sat, Oct 01, 2016 at 08:13:36PM -0700, Krister Johansen escreveu: > > > diff --git a/tools/perf/util/callcha

Re: callchain map refcounting fixes was Re: [PATCH perf/core] perf script: fix a use after free crash.

2016-10-06 Thread Namhyung Kim
Hi Arnaldo and Krister, On Wed, Oct 05, 2016 at 08:45:24AM -0300, Arnaldo Carvalho de Melo wrote: > Em Sat, Oct 01, 2016 at 08:13:36PM -0700, Krister Johansen escreveu: > > If dso__load_kcore frees all of the existing maps, but one has already > > been attached to a callchain cursor node, then we

Re: callchain map refcounting fixes was Re: [PATCH perf/core] perf script: fix a use after free crash.

2016-10-05 Thread Krister Johansen
On Wed, Oct 05, 2016 at 08:45:24AM -0300, Arnaldo Carvalho de Melo wrote: > Em Sat, Oct 01, 2016 at 08:13:36PM -0700, Krister Johansen escreveu: > > If dso__load_kcore frees all of the existing maps, but one has already > > been attached to a callchain cursor node, then we can get a SIGSEGV in > >

Re: callchain map refcounting fixes was Re: [PATCH perf/core] perf script: fix a use after free crash.

2016-10-05 Thread Masami Hiramatsu
On Wed, 5 Oct 2016 08:45:24 -0300 Arnaldo Carvalho de Melo wrote: > Em Sat, Oct 01, 2016 at 08:13:36PM -0700, Krister Johansen escreveu: > > If dso__load_kcore frees all of the existing maps, but one has already > > been attached to a callchain cursor node, then we can get a SIGSEGV in > > any fu

callchain map refcounting fixes was Re: [PATCH perf/core] perf script: fix a use after free crash.

2016-10-05 Thread Arnaldo Carvalho de Melo
Em Sat, Oct 01, 2016 at 08:13:36PM -0700, Krister Johansen escreveu: > If dso__load_kcore frees all of the existing maps, but one has already > been attached to a callchain cursor node, then we can get a SIGSEGV in > any function that happens to try to use this cursor with the invalid > map. Use t

[PATCH perf/core] perf script: fix a use after free crash.

2016-10-01 Thread Krister Johansen
If dso__load_kcore frees all of the existing maps, but one has already been attached to a callchain cursor node, then we can get a SIGSEGV in any function that happens to try to use this cursor with the invalid map. Use the existing map refcount mechanism to forestall cleanup of a map until the cu