linux-stable/tools/perf
Patrick Palka 6eeefccdcf perf bench: Fix NULL pointer dereference in "perf bench all"
The for_each_bench() macro must check that the "benchmarks" field of a
collection is not NULL before dereferencing it because the "all"
collection in particular has a NULL "benchmarks" field (signifying that
it has no benchmarks to iterate over).

This fixes this NULL pointer dereference when running "perf bench all":

  [root@ssdandy ~]# perf bench all
  <SNIP>

  # Running mem/memset benchmark...
  # Copying 1MB Bytes ...

         2.453675 GB/Sec
        12.056327 GB/Sec (with prefault)

  Segmentation fault (core dumped)
  [root@ssdandy ~]#

Signed-off-by: Patrick Palka <patrick@parcs.ath.cx>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1394664051-6037-1-git-send-email-patrick@parcs.ath.cx
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2014-03-14 13:45:54 -03:00
..
arch perf tools: Introduce zfree 2013-12-27 15:17:00 -03:00
bench perf bench numa: Make no args mean 'run all tests' 2014-03-14 10:04:10 -03:00
config perf tools: fix BFD detection on opensuse 2014-02-27 18:29:08 -03:00
Documentation perf record: Rename --initial-delay to --delay 2014-01-14 17:58:12 -03:00
python perf python: Remove duplicate TID bit from mask 2013-08-07 17:35:25 -03:00
scripts perf tools: Finish the removal of 'self' arguments 2013-11-05 15:32:36 -03:00
tests perf tests: No need to set up ref_reloc_sym 2014-01-31 17:21:52 -03:00
ui perf evlist: Introduce evlist__for_each() & friends 2014-01-13 10:06:25 -03:00
util perf machine: Use map as success in ip__resolve_ams 2014-03-10 11:19:36 -03:00
.gitignore perf tools: Ignore 'perf timechart' output file 2013-10-11 12:17:37 -03:00
builtin-annotate.c perf evlist: Introduce evlist__for_each() & friends 2014-01-13 10:06:25 -03:00
builtin-bench.c perf bench: Fix NULL pointer dereference in "perf bench all" 2014-03-14 13:45:54 -03:00
builtin-buildid-cache.c perf buildid-cache: Check relocation when checking for existing kcore 2014-01-31 17:21:54 -03:00
builtin-buildid-list.c perf session: Separating data file properties from session 2013-10-21 17:33:25 -03:00
builtin-diff.c perf diff: Color the Weighted Diff column 2014-01-13 11:38:25 -03:00
builtin-evlist.c perf evlist: Introduce evlist__for_each() & friends 2014-01-13 10:06:25 -03:00
builtin-help.c perf help: Fix --help for builtins 2012-10-22 12:35:49 -02:00
builtin-inject.c perf evlist: Introduce evlist__for_each() & friends 2014-01-13 10:06:25 -03:00
builtin-kmem.c perf evsel: Ditch evsel->handler.data field 2013-11-07 10:40:47 -03:00
builtin-kvm.c perf evlist: Introduce evlist__for_each() & friends 2014-01-13 10:06:25 -03:00
builtin-list.c perf list: Add usage 2013-11-05 14:26:41 -03:00
builtin-lock.c perf evsel: Ditch evsel->handler.data field 2013-11-07 10:40:47 -03:00
builtin-mem.c perf mem: Remove unused parameter from dump_raw_samples() 2013-12-19 17:03:39 -03:00
builtin-probe.c perf probe: Release all dynamically allocated parameters 2014-01-16 16:29:02 -03:00
builtin-record.c perf record: Get ref_reloc_sym from kernel map 2014-01-31 17:21:50 -03:00
builtin-report.c perf annotate: Check availability of annotate when processing samples 2014-02-24 11:12:55 -03:00
builtin-sched.c perf tools: Use zfree to help detect use after free bugs 2013-12-27 17:08:19 -03:00
builtin-script.c perf evlist: Introduce evlist__for_each() & friends 2014-01-13 10:06:25 -03:00
builtin-stat.c perf evlist: Introduce evlist__for_each() & friends 2014-01-13 10:06:25 -03:00
builtin-timechart.c perf timechart: Fix wrong SVG height 2014-01-20 16:19:08 -03:00
builtin-top.c perf annotate: Check availability of annotate when processing samples 2014-02-24 11:12:55 -03:00
builtin-trace.c perf trace: Decode architecture-specific signal numbers 2014-03-10 11:10:45 -03:00
builtin.h perf tools: Add new mem command for memory access profiling 2013-04-01 12:21:44 -03:00
command-list.txt perf tools: Add new mem command for memory access profiling 2013-04-01 12:21:44 -03:00
CREDITS
design.txt perf/doc: Remove mention of non-existent set_perf_event_pending() from design.txt 2014-01-26 09:37:48 +01:00
Makefile perf tools: Add 'build-test' make target 2014-01-16 16:26:26 -03:00
Makefile.perf perf: tools: Fix cross building 2014-01-15 15:15:05 -03:00
MANIFEST perf tools: Include tools/lib/api/ in MANIFEST 2014-01-13 10:06:26 -03:00
perf-archive.sh perf archive: Make 'f' the last parameter for tar 2012-09-17 13:10:42 -03:00
perf-completion.sh perf completion: Complete 'perf kvm' 2013-12-13 10:30:21 -03:00
perf.c tools/: Convert to new topic libraries 2013-12-16 16:03:27 -03:00
perf.h perf tools: Fix AAAAARGH64 memory barriers 2014-01-29 15:50:57 -03:00