[PATCH] ARM: stacktrace: disregard .entry.text when looking for exception frames

Linus Walleij linus.walleij at linaro.org
Thu Nov 5 09:28:54 EST 2020


On Thu, Oct 29, 2020 at 7:59 PM Ard Biesheuvel <ardb at kernel.org> wrote:

> This is not quite correct - identifying the exception frame should be
> based on 'where' not 'from' when relying on .irqentry.text annotations
> but we don't emit those unless CONFIG_FUNCTION_GRAPH_TRACER is
> enabled.
>
> I don't understand this well enough to disentangle it, and other
> KASAN-enabled architectures simply disable instrumentation for the
> stack traversal code, so I propose we do the same for ARM
>
> I.e.,
>
> diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
> index 6a44ffd9c7b4..dad77b0bb734 100644
> --- a/arch/arm/kernel/Makefile
> +++ b/arch/arm/kernel/Makefile
> @@ -21,6 +21,9 @@ obj-y         := elf.o entry-common.o irq.o opcodes.o \
>                    setup.o signal.o sigreturn_codes.o \
>                    stacktrace.o sys_arm.o time.o traps.o
>
> +KASAN_SANITIZE_stacktrace.o := n
> +KASAN_SANITIZE_traps.o := n

Reviewed-by: Linus Walleij <linus.walleij at linaro.org>

for this approach. Just cook this into a proper patch and then put it in
Russell's patch tracker I'd say.

If people really want to probe around this code then they can invest the
time to analyze the code paths.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list