Re: [patch RFC 5/5] x86/speculation: Add basic speculation control code

From: David Woodhouse
Date: Wed Jan 10 2018 - 08:59:14 EST


On Wed, 2018-01-10 at 14:46 +0100, Thomas Gleixner wrote:
>
> So here is the simple list of questions all to be answered with YES or
> NO. I don't want to see any of the 'but, though ...'. We all know by now
> that it's CPU dependent and slow and whatever and that IBRS_ATT will be in
> future CPUs. So get your act together and tell a clear YES or NO.

This is actually covered by the documentation. Someone really should
send you a copy.

> 1) Does IBRS=1 when set once act as a set-and-forget option ?

Never on current hardware. In future with IBRS_ATT, yes.

> Â1a) If the answer to #1 is yes, is it more secure than toggling it?

No, just faster.

> Â1b) If the answer to #1 is yes, is retpoline required ?

No. We'll ALTERNATIVE it away if we have IBRS_ATT.

> Â1c) If the answer to #1 is yes, is RSB stuffing required ?

Not for IBRS_ATT, with weasel words about requiring SMEP.

> 2) Does toggle mode of IBRS require retpoline ?

No. Retpoline is an *alternative* to IBRS, for protecting the kernel.

> 3) Does toggle mode of IBRS require RSB stuffing ?

Yes for kernel entry if you have no SMEP. And yes on vmexit.

> 4) Exist CPUs which require IBRS to be selected automatically ?
>
> ÂÂ 4b) If yes, provide the list as a separate answer please

You mean CPUs on which retpoline isn't sufficient and thus the Âkernel
should prefer IBRS "automatically" without a command line option?

As discussed, yes on Skylake and anything after it that doesn't have
IBRS_ATT, because there are tiny theoretical gaps that retpoline
doesn't handle. But the option of sacrificing goats may be perfectly
acceptable.

Attachment: smime.p7s
Description: S/MIME cryptographic signature