From 6229d57677bd85b984b3ffe1e17db0f514508986 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 26 Jun 2023 15:19:54 +0000 Subject: [PATCH] Revert "arm64: Stash shadow stack pointer in the task struct on interrupt" This reverts commit 3f225f29c69c13ce1cbdb1d607a42efeef080056 which is commit 59b37fe52f49955791a460752c37145f1afdcad1 upstream. It breaks some test systems, so obviously the backport to 5.10.y wasn't quite correct :( Revert it for now until this can be figured out better. Cc: Ard Biesheuvel Cc: Kees Cook Cc: Mark Rutland Cc: Catalin Marinas Signed-off-by: Greg Kroah-Hartman Change-Id: I1071c357225a8b41f15767a27b5c56cf94d7a5f7 --- arch/arm64/kernel/entry.S | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 6daea7bffb2d..c747ebff5d09 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -530,7 +530,9 @@ SYM_CODE_END(__swpan_exit_el0) .macro irq_stack_entry mov x19, sp // preserve the original sp - scs_save tsk // preserve the original shadow stack +#ifdef CONFIG_SHADOW_CALL_STACK + mov x24, scs_sp // preserve the original shadow stack +#endif /* * Compare sp with the base of the task stack. @@ -564,7 +566,9 @@ SYM_CODE_END(__swpan_exit_el0) */ .macro irq_stack_exit mov sp, x19 - scs_load_current +#ifdef CONFIG_SHADOW_CALL_STACK + mov scs_sp, x24 +#endif .endm /* GPRs used by entry code */