Re: [PATCH v2 3/3] arm64: stacktrace: Convert to ARCH_STACKWALK

From
Mark Rutland <mark.rutland@arm.com>
Date
2020-09-02 18:50:46
Also in
linux-s390, lkml
Reply to
Miroslav Benes, 2020-09-02
On Wed, Sep 02, 2020 at 11:32:13AM +0200, Miroslav Benes wrote:
Hi,

it could be a silly question, but better to ask...
quoted
+	if (regs)
+		start_backtrace(&frame, regs->regs[29], regs->pc);
+	else
+		start_backtrace(&frame, thread_saved_fp(task),
+				thread_saved_pc(task));
Would this also work for task == current? Given that the original code had
quoted
-		start_backtrace(&frame,
-				(unsigned long)__builtin_frame_address(0),
-				(unsigned long)__save_stack_trace);
Oh whoops; I'm annoyed I didn't spot that.

With that gone this cannot work for (task == current && regs == NULL), as
we'll erroneously use stale values from the task struct.

It looks like the LKDTM tests only trigger cases with non-NULL regs, but
IIUC this should show up with show_stack(NULL, NULL, KERN_INFO), as
drivers/tty/sysrq.c does for other cpus.

Thanks,
Mark.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (12 messages) 12 messages, 3 authors, last reply 2020-09-10
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help