From: Andi Kleen<ak@xxxxxxxxxxxxxxx>
perf record checks for buffer overflow, but checked for the wrong
size for callchains. callchains are 8 bytes each, not 1.
Signed-off-by: Andi Kleen<ak@xxxxxxxxxxxxxxx>
---
tools/perf/util/evsel.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index f421f7c..90c0756 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -550,7 +550,7 @@ int perf_event__parse_sample(const union perf_event *event, u64 type,
data->callchain = (struct ip_callchain *)array;
- if (sample_overlap(event, array, data->callchain->nr))
+ if (sample_overlap(event, array, (1 + data->callchain->nr) * 8))
return -EFAULT;
array += 1 + data->callchain->nr;