Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751374AbeAPR5k (ORCPT + 1 other); Tue, 16 Jan 2018 12:57:40 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59452 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750908AbeAPR5i (ORCPT ); Tue, 16 Jan 2018 12:57:38 -0500 Date: Tue, 16 Jan 2018 17:57:34 +0000 From: Catalin Marinas To: Jerome Marchand Cc: linux-arm-kernel@lists.infradead.org, Pratyush Anand , Will Deacon , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] arm64: fix unwind_frame() for filtered out fn for function graph tracing Message-ID: <20180116175734.4rp4bewr7us4jypk@armageddon.cambridge.arm.com> References: <20180112104832.9417-1-jmarchan@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180112104832.9417-1-jmarchan@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Fri, Jan 12, 2018 at 11:48:32AM +0100, Jerome Marchand wrote: > diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c > index 76809ccd309c..5a528c58ef68 100644 > --- a/arch/arm64/kernel/stacktrace.c > +++ b/arch/arm64/kernel/stacktrace.c > @@ -59,6 +59,10 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) > #ifdef CONFIG_FUNCTION_GRAPH_TRACER > if (tsk->ret_stack && > (frame->pc == (unsigned long)return_to_handler)) { > + WARN_ON(frame->graph == -1); > + if (frame->graph < -1) > + frame->graph += FTRACE_NOTRACE_DEPTH; > + > /* > * This is a case where function graph tracer has > * modified a return address (LR) in a stack frame So do we still allow this to continue if graph == -1? The following line doesn't seem safe: frame->pc = tsk->ret_stack[frame->graph--].ret; -- Catalin