Re: [PATCH] x86/entry/64: randomize kernel stack offset upon syscall
From: Kees Cook
Date: Wed May 29 2019 - 14:39:18 EST
On Wed, May 29, 2019 at 10:13:43AM +0000, Reshetova, Elena wrote:
> Not sure about ideal params for the whole combination here since security
> and performance are basically conflicting with each other (as usual).
> So, that's why I was trying to propose to have two version of this:
> - one with tilt towards performance (rdtsc based)
> - one with tilt towards security (CRNG-based)
> And then let users choose what matters more for their workload.
> For normal things like dektops, etc. CRNG based version won't provide
> any noticeable overhead. It might only matter for syscall sensitive workloads,
> which btw, most likely not enable quite a bunch of other security protections,
I think people that care about this would prefer the CRNG, and will be
much less interested in the performance issues. But giving people the
option to choose it at runtime seems sensible. Though really, for any
"real" workloads, it's totally lost in the noise, even with the CRNG.
> so I would say that for them to have even rdtsc() version is actually an
> improvement in their defenses for stack (and basically no impact on performance).
Yeah, I think a static-key based version of this would be very nice and
would stay out of anyone's way that didn't want it.
--
Kees Cook