Re: [PATCH 1/2] arm64: Implement arch_stack_walk_reliable

From: Breno Leitao
Date: Thu Mar 13 2025 - 14:15:42 EST


On Fri, Mar 07, 2025 at 05:27:41PM -0800, Song Liu wrote:
> With proper exception boundary detection, it is possible to implment
> arch_stack_walk_reliable without sframe.
>
> Note that, arch_stack_walk_reliable does not guarantee getting reliable
> stack in all scenarios. Instead, it can reliably detect when the stack
> trace is not reliable, which is enough to provide reliable livepatching.
>
> This version has been inspired by Weinan Liu's patch [1].
>
> [1] https://lore.kernel.org/live-patching/20250127213310.2496133-7-wnliu@xxxxxxxxxx/
> Signed-off-by: Song Liu <song@xxxxxxxxxx>

Tested-by: Breno Leitao <leitao@xxxxxxxxxx>

> arch/arm64/Kconfig | 2 +-
> arch/arm64/include/asm/stacktrace/common.h | 1 +
> arch/arm64/kernel/stacktrace.c | 44 +++++++++++++++++++++-
> 3 files changed, 45 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 940343beb3d4..ed4f7bf4a879 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -275,6 +275,7 @@ config ARM64
> select HAVE_SOFTIRQ_ON_OWN_STACK
> select USER_STACKTRACE_SUPPORT
> select VDSO_GETRANDOM
> + select HAVE_RELIABLE_STACKTRACE

Can we really mark this is reliable stacktrace? I am wondering
if we need an intermediate state (potentially reliable stacktrace?)
until we have a fully reliable stack unwinder.

Thanks for working on it.
--breno