]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit - tools/perf/util/hist.c
perf callchain: Reference count maps
authorKrister Johansen <kjlx@templeofstupid.com>
Fri, 6 Jan 2017 06:23:31 +0000 (22:23 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 2 Feb 2017 14:39:09 +0000 (11:39 -0300)
commitaa33b9b9a2ebb00d33c83a5312d4fbf2d5aeba36
treebb0805b62c31bfee44ae018eac68214c0e40d1e1
parenta1c9f97f0b64e6337d9cfcc08c134450934fdd90
perf callchain: Reference count maps

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 invalid cursor.  Use the
existing map refcount mechanism to forestall cleanup of a map until the
cursor iterates past the node.

Signed-off-by: Krister Johansen <kjlx@templeofstupid.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: stable@kernel.org
Fixes: 84c2cafa2889 ("perf tools: Reference count struct map")
Link: http://lkml.kernel.org/r/20170106062331.GB2707@templeofstupid.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/callchain.c
tools/perf/util/callchain.h
tools/perf/util/hist.c