Re: [PATCH 0/8] stackleak: fixes and rework

From: Kees Cook
Date: Tue Apr 26 2022 - 13:53:12 EST

On Mon, 25 Apr 2022 12:55:55 +0100, Mark Rutland wrote:
> This series reworks the stackleak code. The first patch fixes some
> latent issues on arm64, and the subsequent patches improve the code to
> improve clarity and permit better code generation.
> I started working on this as a tangent from rework to arm64's stacktrace
> code. Looking at users of the `on_*_stack()` helpers I noticed that the
> assembly generated for stackleak was particularly awful as it performed
> a lot of redundant work and also called instrumentable code, which isn't
> sound.
> [...]

Applied to for-next/hardening, thanks!

[1/8] arm64: stackleak: fix current_top_of_stack()
[2/8] stackleak: move skip_erasing() check earlier
[3/8] stackleak: rework stack low bound handling
[4/8] stackleak: clarify variable names
[5/8] stackleak: rework stack high bound handling
[6/8] stackleak: remove redundant check
[7/8] stackleak: add on/off stack variants
[8/8] arm64: entry: use stackleak_erase_on_task_stack()

Kees Cook