Re: [PATCH] x86/speculation: Use Indirect Branch Prediction Barrier in context switch

From: Josh Poimboeuf
Date: Tue Jan 30 2018 - 12:49:12 EST


On Mon, Jan 29, 2018 at 10:04:47PM +0000, David Woodhouse wrote:
> From: Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx>
>
> Flush indirect branches when switching into a process that marked itself
> non dumpable. This protects high value processes like gpg better,
> without having too high performance overhead.

I wonder what the point of this patch is. An audit of my laptop shows
only a single user of PR_SET_DUMPABLE: systemd-coredump.

[ And yes, I have gpg-agent running. Also, a grep of the gnupg source
doesn't show any evidence of it being used there. So the gpg thing
seems to be a myth. ]

But also, I much preferred the original version of the patch which only
skipped IBPB when 'prev' could ptrace 'next'.

If performance is a concern, let's look at that in more detail. But I
don't see how the solution to a performance issue could possibly be
"leave (almost) all tasks vulnerable by default."

If the argument is that everyone should "rebuild the world" with
retpolines, then this patch would still be pointless, as we wouldn't
even need IBPB.

--
Josh