Re: [PATCH] perf: top: fix a segfault when kernel map is restricted.

From: Arnaldo Carvalho de Melo
Date: Mon May 04 2015 - 16:55:16 EST


Em Fri, Apr 24, 2015 at 11:35:29PM +0000, Wang Nan escreveu:
> Perf top raise a warning if a kernel sample is collected but kernel map
> is restricted. The warning message needs to dereference al.map->dso...
> However, previous perf_event__preprocess_sample() doesn't always
> guarantee al.map != NULL, for example, when kernel map is restricted.
>
> This patch validates al.map before dereferencing, avoid the segfault.
>
> Before this patch:
>
> $ cat /proc/sys/kernel/kptr_restrict
> 1
> $ perf top -p 120183

Thanks, applied.

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/