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

2018-03-23 Thread Maciej S. Szmigiero
On 22.03.2018 16:46, Dave Hansen wrote: > On 03/21/2018 05:09 PM, Maciej S. Szmigiero wrote: >> As far as I understand the issue this should provide a good protection >> for userspace processes that were recompiled with retpolines as they >> won't have any indirect jumps and calls. > > Instead of

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

2018-03-22 Thread Dave Hansen
On 03/21/2018 05:09 PM, Maciej S. Szmigiero wrote: > As far as I understand the issue this should provide a good protection > for userspace processes that were recompiled with retpolines as they > won't have any indirect jumps and calls. Instead of saying "good protection", let's just say that it

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

2018-03-21 Thread Maciej S. Szmigiero
On 22.03.2018 00:30, Dave Hansen wrote: > On 03/20/2018 04:17 AM, Maciej S. Szmigiero wrote: >> 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 aga

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

2018-03-21 Thread Dave Hansen
On 03/20/2018 04:17 AM, Maciej S. Szmigiero wrote: > 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. >

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

2018-03-21 Thread Maciej S. Szmigiero
On 21.03.2018 15:05, Dave Hansen wrote: > 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 i

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

2018-03-21 Thread Dave Hansen
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

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

2018-03-20 Thread Maciej S. Szmigiero
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 ex