[PATCH 2/2] arm64: move on_thread_stack() to <asm/stacktrace.h>
Kees Cook
keescook at chromium.org
Thu Nov 17 14:09:42 PST 2022
On Thu, Nov 17, 2022 at 12:09:02PM +0000, Mark Rutland wrote:
> Currently on_thread_stack() is defined in <asm/processor.h>, depending
> upon definitiong from <asm/stacktrace.h> despite this header not being
> included. This ends up being fragile, and any user of on_thread_stack()
> must include both <asm/processor.h> and <asm/stacktrace.h>.
>
> We organised things this way due to header dependencies back in commit:
>
> 0b3e336601b82c6a ("arm64: Add support for STACKLEAK gcc plugin")
>
> ... but now that we no longer use current_top_of_stack(), and given that
> stackleak includes <asm/stacktrace.h> via <linux/stackleak.h>, we no
> longer need the definition to live in <asm/processor.h>.
>
> Move on_thread_stack() to <asm/stacktrace.h>, where all its dependencies
> are guaranteed to be defined. This requires having arm64's irq.c
> explicitly include <asm/stacktrace.h>, and I've taken the opportunity to
> sort the includes, which were slightly out of order.
>
> There should be no functional change as a result of this patch.
>
> Signed-off-by: Mark Rutland <mark.rutland at arm.com>
Reviewed-by: Kees Cook <keescook at chromium.org>
--
Kees Cook
More information about the linux-arm-kernel
mailing list