Re: x86/clearregs: Register sanitizing at kernel entry for speculation hygiene
From: Andy Lutomirski
Date: Tue Jan 09 2018 - 20:16:11 EST
> On Jan 9, 2018, at 5:03 PM, Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:
>
> This patch kit implements clearing of all unused registers on kernel entries,
> including system calls and all exceptions and interrupt.
>
> This doesn't fix any known issue, but will make it harder in general
> to exploit the kernel with speculation because it will be harder
> to get user controlled values into kernel code.
I don't like this at all. Once upon a time, Linux syscalls were supposed to be fast. Then we learned about the Meltdown screwup, so we mostly fixed it for real upstream and the distroa seriously half-arsed their own fixes [1]. This came with a big performance cost, but it can be turned off on non-busted hardware. So be it.
But now we're proposing to throw out the whole fast path because it might make it a bit harder to do the most obvious attack. Not very hard, mind you, but a little bit harder. And there's no off switch for less-leaky hardware. No thanks.
Meanwhile we're doing nothing whatsoever to mitigate cross-process attacks because we can't do anything about it short of turning IBRS on systemwide.