[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200408160257.GB11322@linux.intel.com>
Date: Wed, 8 Apr 2020 09:02:57 -0700
From: Sean Christopherson <sean.j.christopherson@...el.com>
To: Christoph Hellwig <hch@...radead.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>, tglx@...utronix.de,
linux-kernel@...r.kernel.org, mingo@...hat.com, bp@...en8.de,
hpa@...or.com, x86@...nel.org, kenny@...ix.com, jeyu@...nel.org,
rasmus.villemoes@...vas.dk, pbonzini@...hat.com,
fenghua.yu@...el.com, xiaoyao.li@...el.com, nadav.amit@...il.com,
thellstrom@...are.com, tony.luck@...el.com,
gregkh@...uxfoundation.org, jannh@...gle.com,
keescook@...omium.org, David.Laight@...lab.com,
dcovelli@...are.com, mhiramat@...nel.org
Subject: Re: [PATCH 4/4] x86,module: Detect CRn and DRn manipulation
On Wed, Apr 08, 2020 at 08:46:02AM -0700, Christoph Hellwig wrote:
> On Wed, Apr 08, 2020 at 05:44:19PM +0200, Peter Zijlstra wrote:
> > On Wed, Apr 08, 2020 at 09:27:26AM -0400, Steven Rostedt wrote:
> > > On Tue, 07 Apr 2020 13:02:40 +0200
> > > Peter Zijlstra <peterz@...radead.org> wrote:
> >
> > > > + if (insn_is_mov_CRn(&insn) || insn_is_mov_DRn(&insn)) {
> > > > + pr_err("Module writes to CRn or DRn, please use the proper accessors: %s\n", mod->name);
> > > > + return -ENOEXEC;
> > > > + }
> > > > +
> > >
> > > Something like this should be done for all modules, not just out of tree
> > > modules.
> >
> > I'm all for it; but people were worried scanning all modules was too
> > expensive (I don't really believe it is, module loading just can't be a
> > hot-path). Also, in-tree modules are audited a lot more than out of tree
> > magic voodoo crap.
>
> Scanning all modules seems safer. While we're at it - can be move the
> kvm bits using VMX to be always in the core kernel and just forbid
> modules from using those instructions entirely?
Practically speaking, no. Turning VMX on and off (literally VMXON/VMXOFF)
could be moved to helpers in the kernel, but KVM relies on inlining all
post-VMXON instructions (except for VMLAUNCH/VMRESUME) for performance.
VMLAUNCH/VMRESUME have their own caveats, moving them out of KVM would be
messy, to say the least.
Powered by blists - more mailing lists