lkml.org 
[lkml]   [2018]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3] arm64: fix unwind_frame() for filtered out fn for function graph tracing
From
Date
On 16/01/18 18:57, Catalin Marinas wrote:
> 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;
>

You're right. We probably should return a error (-EINVAL I guess) if
this happens. Note that this shouldn't happen here and if we're
confident enough that profile_pc() was the only faulty caller, we could
just drop the warning.

Jerome

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2018-01-18 00:20    [W:0.423 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site