Re: Avoid speculative indirect calls in kernel
From: Willy Tarreau
Date: Sun Jan 07 2018 - 12:47:22 EST
On Sun, Jan 07, 2018 at 02:01:38PM +0000, Alan Cox wrote:
> > I disagree. When there are patches that slow execution down up to 30%,
> > I want to be able to mark a binary as "trusted" so that I can run it
>
> It's not a binary that is trusted - it's a binary in a given use case.
> You could easily have the same binary being run in two situations on the
> same box at the same time and run just one of them 'trusted'.
That's what I like with the prctl approach. This can end up as a config
option in the application itself. At least I'd see it like this in
haproxy. Basically :
- start it with enough privileges (always the case to warrant chroot()
then setuid())
- if config option "disable-kpti" is set, run prctl() to disable it.
It is sufficiently inconvenient to ensure that it's only done where
relevant and regardless of the executable itself (ie it should not be
an xattr on the FS for example).
Willy