Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752667AbbEDUzO (ORCPT ); Mon, 4 May 2015 16:55:14 -0400 Received: from mail.kernel.org ([198.145.29.136]:36098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751650AbbEDUy7 (ORCPT ); Mon, 4 May 2015 16:54:59 -0400 Date: Wed, 29 Apr 2015 19:12:03 -0300 From: Arnaldo Carvalho de Melo To: Wang Nan Cc: a.p.zijlstra@chello.nl, paulus@samba.org0, dsahern@gmail.com, jolsa@kernel.org, mingo@redhat.com, lizefan@huawei.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf: top: fix a segfault when kernel map is restricted. Message-ID: <20150429221203.GD29633@kernel.org> References: <1429918529-225417-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1429918529-225417-1-git-send-email-wangnan0@huawei.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 793 Lines: 22 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/