[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c5e53502274a29e39c996627a35a7aa8e0795ca9.camel@intel.com>
Date: Wed, 2 Mar 2022 01:59:46 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "keescook@...omium.org" <keescook@...omium.org>,
"peterz@...radead.org" <peterz@...radead.org>,
"Poimboe, Josh" <jpoimboe@...hat.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Cooper, Andrew" <andrew.cooper3@...rix.com>,
"hjl.tools@...il.com" <hjl.tools@...il.com>,
"rostedt@...dmis.org" <rostedt@...dmis.org>,
"joao@...rdrivepizza.com" <joao@...rdrivepizza.com>,
"samitolvanen@...gle.com" <samitolvanen@...gle.com>,
"x86@...nel.org" <x86@...nel.org>,
"mark.rutland@....com" <mark.rutland@....com>,
"alexei.starovoitov@...il.com" <alexei.starovoitov@...il.com>,
"Milburn, Alyssa" <alyssa.milburn@...el.com>,
"mhiramat@...nel.org" <mhiramat@...nel.org>,
"mbenes@...e.cz" <mbenes@...e.cz>,
"ndesaulniers@...gle.com" <ndesaulniers@...gle.com>
Subject: Re: [PATCH v2 18/39] x86/ibt: Add IBT feature, MSR and #CP handling
On Tue, 2022-03-01 at 15:13 -0800, Josh Poimboeuf wrote:
> On Tue, Mar 01, 2022 at 10:02:45PM +0100, Peter Zijlstra wrote:
> > On Tue, Mar 01, 2022 at 04:14:42PM +0100, Peter Zijlstra wrote:
> >
> > > Something like so?
> > >
> > > diff --git a/arch/x86/kernel/relocate_kernel_64.S
> > > b/arch/x86/kernel/relocate_kernel_64.S
> > > index 399f075ccdc4..5b65f6ec5ee6 100644
> > > --- a/arch/x86/kernel/relocate_kernel_64.S
> > > +++ b/arch/x86/kernel/relocate_kernel_64.S
> > > @@ -114,6 +114,14 @@
> > > SYM_CODE_START_LOCAL_NOALIGN(identity_mapped)
> > > /* store the start address on the stack */
> > > pushq %rdx
> > >
> > > + /*
> > > + * Clear X86_CR4_CET (if it was set) such that we can clear
> > > CR0_WP
> > > + * below.
> > > + */
> > > + movq %cr4, %rax
> > > + andq $~(X86_CR4_CET), %rax
> > > + movq %rax, %cr4
> > > +
> > > /*
> > > * Set cr0 to a known state:
> > > * - Paging enabled
> >
> > I *think* it worked, I 'apt install kexec-tools' and copied the
> > magic
> > commands Josh gave over IRC and the machine went and came back real
> > quick.
> >
> > Lacking useful console I can't say much more.
> >
> > I pushed out a version with these things on.
>
> I just used your latest git tree, kexec into a non-IBT kernel worked
> for
> me as well.
I copied this over to the userspace series and it worked where it
failed before. And looking at the code, it seems like it should work as
well.
As for pinning strength, I'm not understanding this kexec asm enough to
say for sure how much better it is than just removing the bit from the
pinning mask. I think some future hardening around preventing turning
off IBT might still be worthwhile.
Kees, I think you brought up the pinning, what do you think of this?
Powered by blists - more mailing lists