Thread (6 messages) 6 messages, 3 authors, 2025-06-16

Re: [PATCH -next] arm64/ptrace: Fix stack-out-of-bounds read in regs_get_kernel_stack_nth()

From: Heiko Carstens <hca@linux.ibm.com>
Date: 2025-06-13 15:04:58
Also in: lkml

On Thu, Jun 12, 2025 at 05:33:32PM +0100, Will Deacon wrote:
On Wed, Jun 04, 2025 at 12:55:33AM +0000, Tengda Wu wrote:
quoted
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index f79b0d5f71ac..fe3f7e554d14 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -141,7 +141,7 @@ unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, unsigned int n)
 
 	addr += n;
 	if (regs_within_kernel_stack(regs, (unsigned long)addr))
-		return *addr;
+		return READ_ONCE_NOCHECK(addr);
I think this should be '*addr', but that makes me wonder wtf s390 is
doing...
That's obviously a brown paper bag bug in our code... will be fixed.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help