linux/tools/perf
Jiri Olsa a65cb4b9f8 perf evlist: Fix perf_evlist__mmap_read event overflow
The perf_evlist__mmap_read used 'union perf_event' as a placeholder for
event crossing the mmap boundary.

This is ok for sample shorter than ~PATH_MAX. However we could grow up
to the maximum sample size which is 16 bits max.

I hit this overflow issue when using 'perf top -G dwarf' which produces
sample with the size around 8192 bytes.  We could configure any valid
sample size here using: '-G dwarf,size'.

Using array with sample max size instead for the event placeholder. Also
adding another safe check for the dynamic size of the user stack.

TODO: The 'struct perf_mmap' is quite big now, maybe we could use some
lazy allocation for event_copy size.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1380721599-24285-1-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-10-11 12:17:40 -03:00
..
arch tools/perf: Standardize feature support define names to: HAVE_{FEATURE}_SUPPORT 2013-10-09 08:48:28 +02:00
bench perf bench: Fix failing assertions in numa bench 2013-10-11 12:17:38 -03:00
config perf tools: Add missing -ldl for gtk build 2013-10-11 12:17:29 -03:00
Documentation perf tools: Add possibility to specify mmap size 2013-10-09 11:24:20 -03:00
python perf python: Remove duplicate TID bit from mask 2013-08-07 17:35:25 -03:00
scripts perf script: Fix broken include in Context.xs 2013-07-10 13:47:00 -03:00
tests perf evlist: Introduce perf_evlist__new_default function 2013-10-09 11:24:34 -03:00
ui perf tools: Separate out GTK codes to libperf-gtk.so 2013-10-09 15:55:25 -03:00
util perf evlist: Fix perf_evlist__mmap_read event overflow 2013-10-11 12:17:40 -03:00
.gitignore perf tools: Ignore 'perf timechart' output file 2013-10-11 12:17:37 -03:00
bash_completion perf completion: Use more comp words 2013-10-09 11:12:31 -03:00
builtin-annotate.c perf tools: Separate out GTK codes to libperf-gtk.so 2013-10-09 15:55:25 -03:00
builtin-bench.c tools/perf: Standardize feature support define names to: HAVE_{FEATURE}_SUPPORT 2013-10-09 08:48:28 +02:00
builtin-buildid-cache.c perf buildid-cache: Add --update option 2013-02-14 14:59:27 -03:00
builtin-buildid-list.c perf symbols: Generalize filter in __fprintf_buildid methods 2012-12-09 08:46:07 -03:00
builtin-diff.c tools/perf: Add support for record transaction flags 2013-10-04 10:06:12 +02:00
builtin-evlist.c perf evlist: Pass the event_group info via perf_attr_details 2013-02-06 18:09:28 -03:00
builtin-help.c
builtin-inject.c tools/perf: Standardize feature support define names to: HAVE_{FEATURE}_SUPPORT 2013-10-09 08:48:28 +02:00
builtin-kmem.c perf kmem: Make it work again on non NUMA machines 2013-09-24 14:13:46 -03:00
builtin-kvm.c perf tools: Check mmap pages value early 2013-10-09 11:24:10 -03:00
builtin-list.c perf list: List kernel supplied event aliases 2013-07-12 13:53:53 -03:00
builtin-lock.c perf lock: Account for lock average wait time 2013-10-09 11:24:01 -03:00
builtin-mem.c perf tools: Add attr->mmap2 support 2013-09-11 10:09:32 -03:00
builtin-probe.c tools/perf: Standardize feature support define names to: HAVE_{FEATURE}_SUPPORT 2013-10-09 08:48:28 +02:00
builtin-record.c perf tools: Check mmap pages value early 2013-10-09 11:24:10 -03:00
builtin-report.c perf tools: Separate out GTK codes to libperf-gtk.so 2013-10-09 15:55:25 -03:00
builtin-sched.c perf tools: change machine__findnew_thread() to set thread pid 2013-08-29 11:51:31 -03:00
builtin-script.c perf session: Check for SIGINT in more loops 2013-09-19 11:32:17 -03:00
builtin-stat.c perf stat: Don't print bogus data on -e instructions 2013-10-11 12:17:35 -03:00
builtin-timechart.c perf timechart: Remove event types framework only user 2013-07-15 16:14:47 -03:00
builtin-top.c perf symbols: Add new option --ignore-vmlinux for perf top 2013-10-09 11:42:20 -03:00
builtin-trace.c perf trace: Show path associated with fd in live sessions 2013-10-09 17:43:18 -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
Makefile tools/perf/build: Fix non-canonical directory names in O= 2013-10-09 08:49:01 +02:00
Makefile.perf perf trace: Add 'trace' alias to 'perf trace' 2013-10-11 12:17:10 -03:00
MANIFEST perf tools: Introduce tools/lib/lk library 2013-03-15 13:06:00 -03:00
perf-archive.sh
perf.c perf trace: Add 'trace' alias to 'perf trace' 2013-10-11 12:17:10 -03:00
perf.h tools/perf: Add support for record transaction flags 2013-10-04 10:06:12 +02:00