From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752084AbdJTHXO (ORCPT ); Fri, 20 Oct 2017 03:23:14 -0400 Received: from terminus.zytor.com ([65.50.211.136]:42043 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751783AbdJTHXM (ORCPT ); Fri, 20 Oct 2017 03:23:12 -0400 Date: Fri, 20 Oct 2017 00:18:39 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: namhyung@kernel.org, linux-kernel@vger.kernel.org, dsahern@gmail.com, wangnan0@huawei.com, jolsa@kernel.org, acme@redhat.com, tglx@linutronix.de, andi@firstfloor.org, peterz@infradead.org, yao.jin@linux.intel.com, hpa@zytor.com, changbin.du@intel.com, mingo@kernel.org Reply-To: changbin.du@intel.com, mingo@kernel.org, yao.jin@linux.intel.com, hpa@zytor.com, peterz@infradead.org, tglx@linutronix.de, andi@firstfloor.org, dsahern@gmail.com, wangnan0@huawei.com, acme@redhat.com, jolsa@kernel.org, namhyung@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20171013083736.15037-2-jolsa@kernel.org> References: <20171013083736.15037-2-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf hists: Fix crash in perf_hpp__reset_output_field() Git-Commit-ID: 70b01dfd765dd2196d51f33a49df23954416f34a X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 70b01dfd765dd2196d51f33a49df23954416f34a Gitweb: https://git.kernel.org/tip/70b01dfd765dd2196d51f33a49df23954416f34a Author: Jiri Olsa AuthorDate: Fri, 13 Oct 2017 10:37:28 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 13 Oct 2017 16:43:33 -0300 perf hists: Fix crash in perf_hpp__reset_output_field() Du Changbin reported crash [1] when calling perf_hpp__reset_output_field() after unregistering field via perf_hpp__column_unregister(). This ends up in calling following list_del* sequence on the same format: perf_hpp__column_unregister: list_del(&format->list); perf_hpp__reset_output_field: list_del_init(&fmt->list); where the later list_del_init might touch already freed formats. Fixing this by replacing list_del() with list_del_init() in perf_hpp__column_unregister(). [1] http://marc.info/?l=linux-kernel&m=149059595826019&w=2 Reported-by: Changbin Du Signed-off-by: Jiri Olsa Cc: Andi Kleen Cc: David Ahern Cc: Jin Yao Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/20171013083736.15037-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/ui/hist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index ddb2c6f..6ee6b36 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c @@ -532,7 +532,7 @@ void perf_hpp_list__prepend_sort_field(struct perf_hpp_list *list, void perf_hpp__column_unregister(struct perf_hpp_fmt *format) { - list_del(&format->list); + list_del_init(&format->list); } void perf_hpp__cancel_cumulate(void)