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: Will Deacon <will@kernel.org>
Date: 2025-06-12 16:33:36
Also in: lkml

On Wed, Jun 04, 2025 at 12:55:33AM +0000, Tengda Wu wrote:
quoted hunk ↗ jump to hunk
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...

Will
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help