Skip to contentSkip to conversation

parisc: fix frame pointer in ftrace_regs_caller()

PATCH New Sven Schnelle 1 participant 1 message Oct 30, 2019 PA-RISC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 parisc: fix frame pointer in ftrace_regs_caller()

The current code in ftrace_regs_caller() doesn't assign %r3 to contain the address of the current frame. This is hidden if the kernel is compiled with FRAME_POINTER, but without it just crashes because it tries to dereference an arbitrary address. Fix this by always setting %r3 to the current stack frame.

---
 arch/parisc/kernel/entry.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/parisc/kernel/entry.S +1 -1
index 1d1d748c227f..b96d74496977 100644
@@ -2125,7 +2125,7 @@ ftrace_regs_caller:
 	copy	%rp, %r26
 	LDREG	-FTRACE_FRAME_SIZE-PT_SZ_ALGN(%sp), %r25
 	ldo	-8(%r25), %r25
-	copy	%r3, %arg2
+	ldo	-FTRACE_FRAME_SIZE(%r1), %arg2
 	b,l	ftrace_function_trampoline, %rp
 	copy	%r1, %arg3 /* struct pt_regs */
 
Signature · 1 line
2.23.0