Re: [PATCH v4 08/10] x86: BHI stubs

From: Kees Cook
Date: Tue Feb 25 2025 - 13:31:58 EST


On Tue, Feb 25, 2025 at 09:52:12AM +0100, Peter Zijlstra wrote:
> On Mon, Feb 24, 2025 at 11:01:02AM -0800, Kees Cook wrote:
>
> > On Mon, Feb 24, 2025 at 01:37:11PM +0100, Peter Zijlstra wrote:
> > >
> > > Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> >
> > Did this commit log go missing?
>
> Nah, it never had one.
>
> How does this sound?
>
> ---
>
> Add an array of code thunks, to be called from the FineIBT preamble,
> clobbering the first 'n' argument registers for speculative execution.
>
> Notably the 0th entry will clobber no argument registers and will never
> be used, it exists so the array can be naturally indexed, while the 7th
> entry will clobber all the 6 argument registers and also RSP in order to
> mess up stack based arguments.
>

Yes, this reads well. Thanks!

Reviewed-by: Kees Cook <kees@xxxxxxxxxx>


--
Kees Cook