[RFC PATCH 0/3] arm64: Implement reliable stack trace

Miroslav Benes mbenes at suse.cz
Thu Oct 15 09:39:37 EDT 2020


Hi,

On Mon, 12 Oct 2020, Mark Brown wrote:

> This patch series aims to implement reliable stacktrace for arm64. 
> Reliable stacktrace exists mainly to support live patching, it provides
> a version of stacktrace that checks for consistency problems in the
> traces it generates and provides an error code to callers indicating if
> any problems were detected.      
> 
> This is a first cut of support for arm64, I've not really even started
> testing it meaningfully at this point.  The main thing I'm looking for
> here is that I'm not sure if there are any more potential indicators of
> unrelabile stacks that I'm missing tests for or anything about the
> interfaces that I've misunderstood.

I'll just copy an excerpt from my notes about the required guarantees. 
Written by Josh (CCed, he has better idea about the problem than me 
anyway).

"
The unwinder needs to be able to detect all stack corruption and return
an error.
[ But note that we don't need to worry about unwinding a task's stack
while the task is running, which can be a common source of
"corruption".  For livepatch we make sure every task is blocked
(except when checking the current task). ]

It also needs to:
- detect preemption / page fault frames and return an error
- only return success if it reaches the end of the task stack; for user
  tasks, that means the syscall barrier; for kthreads/idle tasks, that
  means finding a defined thread entry point
- make sure it can't get into a recursive loop
- make sure each return address is a valid text address
- properly detect generated code hacks like function graph tracing and
  kretprobes
"

Miroslav



More information about the linux-arm-kernel mailing list