Re: [PATCH v1] x86: Pin cr4 FSGSBASE

From: Kees Cook
Date: Tue May 26 2020 - 12:20:36 EST


On Tue, May 26, 2020 at 08:48:35AM -0700, Andi Kleen wrote:
> On Tue, May 26, 2020 at 08:56:18AM +0200, Greg KH wrote:
> > On Mon, May 25, 2020 at 10:28:48PM -0700, Andi Kleen wrote:
> > > + if (val & X86_CR4_FSGSBASE) {
> > > + WARN_ONCE(1, "CR4 unexpectedly set FSGSBASE!?\n");
> >
> > What about those systems that panic-on-warn?
>
> I assume they're ok with "panic on root hole"

Exactly. :) The pinning infrastructure is pretty small; will that just
get backported? (Also, we can probably rework the pinning to avoid the
special-casing and use a mask/value pair to notice a bit getting turned
_on_ as well...)

--
Kees Cook