From dde29fdd4027e0ef47e715df1f8d59170ba4b293 Mon Sep 17 00:00:00 2001 From: Prasad Sodagudi Date: Fri, 24 Feb 2017 09:00:53 -0800 Subject: [PATCH] arm64: Disable KASAN in uwwind_frame There is chance of unwinding stack of other task and that task may be executing on other CPU simultaneously. If the other task which is getting unwind may be executing on other cpu, KASAN warning would get printed due stack changes. So disable kasan in unwind_frame while accessing other stack frames. Change-Id: I25107f44e102414cf36e50e0b215a207ae5462d1 Signed-off-by: Prasad Sodagudi --- arch/arm64/kernel/stacktrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c index 85aea381fbf6..cb3eec8e8e50 100644 --- a/arch/arm64/kernel/stacktrace.c +++ b/arch/arm64/kernel/stacktrace.c @@ -69,6 +69,8 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) frame->fp = *(unsigned long *)(fp); frame->pc = *(unsigned long *)(fp + 8); + kasan_enable_current(); + #ifdef CONFIG_FUNCTION_GRAPH_TRACER if (tsk && tsk->ret_stack && (frame->pc == (unsigned long)return_to_handler)) { @@ -112,8 +114,6 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) } } - kasan_enable_current(); - return 0; }