Re: [PATCH] x86/speculation: Fill the RSB on context switch also on non-IBPB CPUs

From: Dave Hansen
Date: Wed Mar 21 2018 - 10:05:29 EST


On 03/20/2018 04:17 AM, Maciej S. Szmigiero wrote:
> If we run on a CPU that does not have IBPB support RSB entries from one
> userspace process can influence 'ret' target prediction in another
> userspace process after a context switch.
>
> Since it is unlikely that existing RSB entries from the previous task match
> the new task call stack we can use the existing unconditional
> RSB-filling-on-context-switch infrastructure to protect against such
> userspace-to-userspace attacks.
>
> This patch brings a change in behavior only for the following CPU types:
> * Intel pre-Skylake CPUs without updated microcode,

The assumption thus far (good or bad) is that everything will get a
microcode update. I actually don't know for sure if RSB manipulation is
effective on old microcode before Skylake. I'm pretty sure it has not
been documented publicly.

How did you decide that this is an effective mitigation?