DORMANTno replies

[PATCH] arm64: don't dump stack for usermode address in show_regs

From: Ding Tianhong <hidden>
Date: 2018-08-28 13:52:29
Subsystem: arm64 port (aarch64 architecture), the rest · Maintainers: Catalin Marinas, Will Deacon, Linus Torvalds

The patch 1149aad10b ("arm64: Add dump_backtrace() in show_regs") would
help to dump the stack when debug in the socklockups, but if the issues
happened in the user space, it will be errors when dumping the usermode
address in kernel, so don't dump stack for usermode address in show_regs.

Signed-off-by: Ding Tianhong <redacted>
---
 arch/arm64/kernel/process.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 7f1628e..454825a 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -249,7 +249,9 @@ void __show_regs(struct pt_regs *regs)
 void show_regs(struct pt_regs * regs)
 {
 	__show_regs(regs);
-	dump_backtrace(regs, NULL);
+
+	if (!user_mode(regs))
+		dump_backtrace(regs, NULL);
 }

 static void tls_thread_flush(void)
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help