Thread (4 messages) 4 messages, 2 authors, 2021-02-03

Re: [PATCH] MIPS: fix kernel_stack_pointer()

From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Date: 2021-02-01 12:24:12
Also in: linux-mips, linux-mm

On Fri, Jan 29, 2021 at 12:35:07PM +0800, Huang Pei wrote:
quoted hunk ↗ jump to hunk
MIPS always save kernel stack pointer in regs[29]

Signed-off-by: Huang Pei <redacted>
---
 arch/mips/include/asm/ptrace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h
index 1e76774b36dd..daf3cf244ea9 100644
--- a/arch/mips/include/asm/ptrace.h
+++ b/arch/mips/include/asm/ptrace.h
@@ -53,7 +53,7 @@ struct pt_regs {
 
 static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
 {
-	return regs->regs[31];
+	return regs->regs[29];
hmm, I'm still wondering where the trick is... looks like this is used
for uprobes, so nobody has ever used uprobes or I'm missing something.

How did you find that ?

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help