From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:53326 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755055AbdCISpd (ORCPT ); Thu, 9 Mar 2017 13:45:33 -0500 Date: Thu, 9 Mar 2017 19:45:23 +0100 From: Greg KH To: Krister Johansen Cc: stable@vger.kernel.org, acme@redhat.com, fweisbec@gmail.com, mhiramat@kernel.org, namhyung@kernel.org Subject: Re: [PATCH stable-4.9] perf callchain: Reference count maps Message-ID: <20170309184523.GA16414@kroah.com> References: <148693698893118@kroah.com> <20170309175720.GA3408@templeofstupid.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170309175720.GA3408@templeofstupid.com> Sender: stable-owner@vger.kernel.org List-ID: On Thu, Mar 09, 2017 at 09:57:20AM -0800, Krister Johansen wrote: > commit aa33b9b9a2ebb00d33c83a5312d4fbf2d5aeba36 upstream. > > If dso__load_kcore frees all of the existing maps, but one has already > been attached to a callchain cursor node, then we can get a SIGSEGV in > any function that happens to try to use this invalid cursor. Use the > existing map refcount mechanism to forestall cleanup of a map until the > cursor iterates past the node. > > Signed-off-by: Krister Johansen > Tested-by: Arnaldo Carvalho de Melo > Cc: Frederic Weisbecker > Cc: Masami Hiramatsu > Cc: Namhyung Kim > Cc: stable@kernel.org > Fixes: 84c2cafa2889 ("perf tools: Reference count struct map") > Link: http://lkml.kernel.org/r/20170106062331.GB2707@templeofstupid.com > Signed-off-by: Arnaldo Carvalho de Melo > --- > tools/perf/util/callchain.c | 11 +++++++++-- > tools/perf/util/callchain.h | 6 ++++++ > tools/perf/util/hist.c | 7 +++++++ > 3 files changed, 22 insertions(+), 2 deletions(-) > > Apologies for the long lead time on this. This is the backport that > I've been using to debug issues on 4.9 kernels in my production > environment. Not a problem, thanks for this, now applied. greg k-h