diff mbox series

arm64: Mark start_backtrace() notrace and NOKPROBE_SYMBOL

Message ID 164301227374.1433152.12808232644267107415.stgit@devnote2 (mailing list archive)
State New, archived
Headers show
Series arm64: Mark start_backtrace() notrace and NOKPROBE_SYMBOL | expand

Commit Message

Masami Hiramatsu (Google) Jan. 24, 2022, 8:17 a.m. UTC
Mark the start_backtrace() as notrace and NOKPROBE_SYMBOL
because this function is called from ftrace and lockdep to
get the caller address via return_address(). The lockdep
is used in kprobes, it should also be NOKPROBE_SYMBOL.

Fixes: b07f3499661c ("arm64: stacktrace: Move start_backtrace() out of the header")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 arch/arm64/kernel/stacktrace.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Mark Brown Jan. 24, 2022, 1:05 p.m. UTC | #1
On Mon, Jan 24, 2022 at 05:17:54PM +0900, Masami Hiramatsu wrote:
> Mark the start_backtrace() as notrace and NOKPROBE_SYMBOL
> because this function is called from ftrace and lockdep to
> get the caller address via return_address(). The lockdep
> is used in kprobes, it should also be NOKPROBE_SYMBOL.

Reviwed-by: Mark Brown <broonie@kernel.org>
Catalin Marinas Jan. 24, 2022, 3:10 p.m. UTC | #2
On Mon, 24 Jan 2022 17:17:54 +0900, Masami Hiramatsu wrote:
> Mark the start_backtrace() as notrace and NOKPROBE_SYMBOL
> because this function is called from ftrace and lockdep to
> get the caller address via return_address(). The lockdep
> is used in kprobes, it should also be NOKPROBE_SYMBOL.

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64: Mark start_backtrace() notrace and NOKPROBE_SYMBOL
      https://git.kernel.org/arm64/c/1e0924bd0991
diff mbox series

Patch

diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c
index 94f83cd44e50..b0f21677764d 100644
--- a/arch/arm64/kernel/stacktrace.c
+++ b/arch/arm64/kernel/stacktrace.c
@@ -33,7 +33,7 @@ 
  */
 
 
-void start_backtrace(struct stackframe *frame, unsigned long fp,
+void notrace start_backtrace(struct stackframe *frame, unsigned long fp,
 		     unsigned long pc)
 {
 	frame->fp = fp;
@@ -55,6 +55,7 @@  void start_backtrace(struct stackframe *frame, unsigned long fp,
 	frame->prev_fp = 0;
 	frame->prev_type = STACK_TYPE_UNKNOWN;
 }
+NOKPROBE_SYMBOL(start_backtrace);
 
 /*
  * Unwind from one frame record (A) to the next frame record (B).