[PATCH] arm64: disable ARCH_CORRECT_STACKTRACE_ON_KRETPROBE tests

Mark Brown broonie at kernel.org
Tue Nov 19 10:06:35 PST 2024


On Mon, Nov 18, 2024 at 12:02:04PM +0000, Mark Rutland wrote:

> The test assumes that when a stacktrace straddles an exception boundary,
> no necessary entries will be omitted and no extraneous entries will be
> reported, and when unwinding from a kretprobed callee, the next entry in
> the trace will be its immediate caller (whether kretprobed or not).

> Recently the arm64 stacktrace code was changed to always report the LR
> at an exception boundary, where we don't know whether the LR is live.
> In the case of the kretprobe trampoline the LR is not live at the time
> the stacktrace is performed, and so the entry in the trace for the LR is
> extraneous. This can be seen if a call to show_stack() is added to
> stacktrace_internal_return_handler():

Oh, that's a bit annoying.  :/

> +++ b/arch/arm64/Kconfig
> @@ -14,7 +14,6 @@ config ARM64
>  	select ARCH_HAS_DEBUG_WX
>  	select ARCH_BINFMT_ELF_EXTRA_PHDRS
>  	select ARCH_BINFMT_ELF_STATE
> -	select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
>  	select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
>  	select ARCH_ENABLE_MEMORY_HOTPLUG
>  	select ARCH_ENABLE_MEMORY_HOTREMOVE

This config option is only used for enabling parts of the kprobes tests
so it's not hurting anything at runtime AFAICT:

Reviewed-by: Mark Brown <broonie at kernel.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20241119/e8ed74a9/attachment.sig>


More information about the linux-arm-kernel mailing list