[PATCH v2 17/21] arm64: entry: Use SPSel to switch to overflow stack
Linus Walleij
linusw at kernel.org
Wed Sep 30 14:22:01 PDT 2026
On Fri, Sep 18, 2026 at 6:15 PM Will Deacon <will at kernel.org> wrote:
> When detecting a stack overflow on exception entry from EL1, use SPSel
> to switch to the overflow stack without corrupting any GPRs. Not only is
> this simpler than the previous logic, but it also opens the door to
> more complicated overflow checks (for example, based on per-task stack
> sizes or stacks which are not aligned to a specific page order) as well
> as the possibility of returning from a stack fault if we were able to
> resolve it.
>
> Cc: Mark Rutland <mark.rutland at arm.com>
> Signed-off-by: Will Deacon <will at kernel.org>
I really like what I see here. The change up to this point
stands alone as a serious stability improvement because you are
not deleting code that made me feel very icky when I was reading
it. Before this patch it was pretty much an
"overflow and crash gracefully" stack, not an overflow stack.
Reviewed-by: Linus Walleij <linusw at kernel.org>
Yours,
Linus Walleij
More information about the linux-arm-kernel
mailing list