Re: [RFC] perf session: Fix compression processing

From: Alexey Budankov
Date: Wed Nov 06 2019 - 11:50:09 EST


On 04.11.2019 1:24, Jiri Olsa wrote:
> hi,
> I'm not sure I follow everything on compression,
> so I might have missed something, but patch below
> fixes the issue for me.
>
> jirka
>
>
> ---
> The compressed data processing occasionally fails with:
> $ perf report --stdio -vv
> decomp (B): 44519 to 163000
> decomp (B): 48119 to 174800
> decomp (B): 65527 to 131072
> fetch_mmaped_event: head=0x1ffe0 event->header_size=0x28, mmap_size=0x20000: fuzzed perf.data?
> Error:
> failed to process sample
> ...
>
> It's caused by recent fuzzer fix that does not take into account
> that compressed data do not need to by fully present in the buffer,
> so it's ok to just return NULL and not to fail.
>
> Fixes: 57fc032ad643 ("perf session: Avoid infinite loop when seeing invalid header.size")
> Link: http://lkml.kernel.org/n/tip-q1biqscs4stcmc9bs1iokfro@xxxxxxxxxxxxxx
> Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
> ---
> tools/perf/util/session.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)

I am on vacations currently, getting back on Monday (11/11).
Please expect delay in response.

~Alexey