linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Jessica Yu <jeyu@kernel.org>,
	Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
	LKML <linux-kernel@vger.kernel.org>,
	x86@kernel.org, "Kenneth R. Crudup" <kenny@panix.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Xiaoyao Li <xiaoyao.li@intel.com>, Nadav Amit <namit@vmware.com>,
	Thomas Hellstrom <thellstrom@vmware.com>,
	Sean Christopherson <sean.j.christopherson@intel.com>,
	Tony Luck <tony.luck@intel.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	jannh@google.com, keescook@chromium.org, vbox-dev@virtualbox.org
Subject: Re: [patch 1/2] x86,module: Detect VMX modules and disable Split-Lock-Detect
Date: Fri, 3 Apr 2020 13:58:17 -0700	[thread overview]
Message-ID: <737F6739-9B8B-4C73-91D3-B873D5780F5E@amacapital.net> (raw)
In-Reply-To: <87o8s8l7t3.fsf@nanos.tec.linutronix.de>


> On Apr 3, 2020, at 11:54 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> 
> Peter Zijlstra <peterz@infradead.org> writes:
>>> On Fri, Apr 03, 2020 at 04:35:00PM +0200, Jessica Yu wrote:
>>> +++ Rasmus Villemoes [03/04/20 01:42 +0200]:
>>>> On 02/04/2020 14.32, Thomas Gleixner wrote:
>>>>> From: Peter Zijlstra <peterz@infradead.org>
>>>>> 
>>>>> It turns out that with Split-Lock-Detect enabled (default) any VMX
>>>>> hypervisor needs at least a little modification in order to not blindly
>>>>> inject the #AC into the guest without the guest being ready for it.
>>>>> 
>>>>> Since there is no telling which module implements a hypervisor, scan the
>>>>> module text and look for the VMLAUNCH instruction. If found, the module is
>>>>> assumed to be a hypervisor of some sort and SLD is disabled.
>>>> 
>>>> How long does that scan take/add to module load time? Would it make
>>>> sense to exempt in-tree modules?
>>>> 
>>>> Rasmus
>>> 
>>> I second Rasmus's question. It seems rather unfortunate that we have
>>> to do this text scan for every module load on x86, when it doesn't
>>> apply to the majority of them, and only to a handful of out-of-tree
>>> hypervisor modules (assuming kvm is taken care of already).
>>> 
>>> I wonder if it would make sense then to limit the text scans to just
>>> out-of-tree modules (i.e., missing the intree modinfo flag)?
>> 
>> It would; didn't know there was one.
> 
> But that still would not make it complete.
> 
> I was staring at virtualbox today after Jann pointed out that this
> sucker does complete backwards things.
> 
>  The kernel driver does not contain any VM* instructions at all.
> 
> The actual hypervisor code is built as a separate binary and somehow
> loaded into the kernel with their own magic fixup of relocations and
> function linking. This "design" probably comes from the original
> virtualbox implementation which circumvented GPL that way.
> 
> TBH, I don't care if we wreckage virtualbox simply because that thing is
> already a complete and utter trainwreck violating taste and common sense
> in any possible way. Just for illustration:
> 
>  - It installs preempt notifiers and the first thing in the callback
>    function is to issue 'stac()'!
> 
>  - There is quite some other horrible code in there which fiddles in
>    the guts of the kernel just because it can.
> 
>  - Conditionals in release code which check stuff like
>    VBOX_WITH_TEXT_MODMEM_HACK, VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV,
>    VBOX_WITH_NON_PROD_HACK_FOR_PERF_STACKS along with the most absurd
>    hacks ever.
> 
> If you feel the need to look yourself, please use your eyecancer
> protection gear.
> 
> Can someone at Oracle please make sure, that this monstrosity gets shred
> in pieces?
> 
> Enough vented, but that still does not solve the SLD problem in any
> sensible way.

Could we unexport set_memory_x perhaps?  And maybe try to make virtualbox break in as many ways as possible?

> 
> Thanks,
> 
>        tglx

  reply	other threads:[~2020-04-03 20:58 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02 12:32 [patch 0/2] x86: Prevent Split-Lock-Detection wreckage on VMX hypervisors Thomas Gleixner
2020-04-02 12:32 ` [patch 1/2] x86,module: Detect VMX modules and disable Split-Lock-Detect Thomas Gleixner
2020-04-02 15:23   ` [patch v2 " Peter Zijlstra
2020-04-02 16:20     ` Xiaoyao Li
2020-04-02 16:25       ` Peter Zijlstra
2020-04-02 16:39         ` Nadav Amit
2020-04-02 16:41         ` Xiaoyao Li
2020-04-02 17:34           ` Thomas Gleixner
2020-04-02 17:51             ` Sean Christopherson
2020-04-02 18:51               ` Peter Zijlstra
2020-04-02 20:23                 ` Sean Christopherson
2020-04-02 21:04                   ` Thomas Gleixner
2020-04-02 21:16                     ` Sean Christopherson
2020-04-03  8:09     ` David Laight
2020-04-03 14:33       ` Peter Zijlstra
2020-04-02 23:42   ` [patch " Rasmus Villemoes
2020-04-03 14:35     ` Jessica Yu
2020-04-03 15:21       ` Peter Zijlstra
2020-04-03 16:01         ` Sean Christopherson
2020-04-03 16:12           ` Peter Zijlstra
2020-04-03 16:16             ` David Laight
2020-04-03 16:39               ` Peter Zijlstra
2020-04-03 16:25             ` Sean Christopherson
2020-04-03 16:40               ` Peter Zijlstra
2020-04-03 16:48                 ` Nadav Amit
2020-04-03 17:21                   ` Sean Christopherson
2020-04-03 18:53         ` Thomas Gleixner
2020-04-03 20:58           ` Andy Lutomirski [this message]
2020-04-03 21:49             ` Thomas Gleixner
2020-04-03 11:29   ` kbuild test robot
2020-04-03 14:43   ` kbuild test robot
2020-04-03 16:36   ` Sean Christopherson
2020-04-03 16:41     ` Peter Zijlstra
2020-04-03 18:35       ` Jessica Yu
2020-04-06 12:23   ` Christoph Hellwig
2020-04-06 14:40     ` Peter Zijlstra
2020-04-06 15:18       ` Christoph Hellwig
2020-04-06 15:22         ` Peter Zijlstra
2020-04-06 18:27           ` Steven Rostedt
2020-04-02 12:33 ` [patch 2/2] x86/kvm/vmx: Prevent split lock detection induced #AC wreckage Thomas Gleixner
2020-04-02 15:30   ` Sean Christopherson
2020-04-02 15:44     ` Nadav Amit
2020-04-02 16:04       ` Sean Christopherson
2020-04-02 16:56     ` Thomas Gleixner
2020-04-02 15:55   ` [PATCH 0/3] x86: KVM: VMX: Add basic split-lock #AC handling Sean Christopherson
2020-04-02 15:55     ` [PATCH 1/3] KVM: x86: Emulate split-lock access as a write in emulator Sean Christopherson
2020-04-02 15:55     ` [PATCH 2/3] x86/split_lock: Refactor and export handle_user_split_lock() for KVM Sean Christopherson
2020-04-02 17:01       ` Thomas Gleixner
2020-04-02 17:19         ` Sean Christopherson
2020-04-02 19:06           ` Thomas Gleixner
2020-04-10  4:39             ` Xiaoyao Li
2020-04-10 10:21               ` Paolo Bonzini
2020-04-02 15:55     ` [PATCH 3/3] KVM: VMX: Extend VMX's #AC interceptor to handle split lock #AC in guest Sean Christopherson
2020-04-02 17:19       ` Thomas Gleixner
2020-04-02 17:40         ` Sean Christopherson
2020-04-02 20:07           ` Thomas Gleixner
2020-04-02 20:36             ` Andy Lutomirski
2020-04-02 20:48             ` Peter Zijlstra
2020-04-02 20:51             ` Sean Christopherson
2020-04-02 22:27               ` Thomas Gleixner
2020-04-02 22:40                 ` Nadav Amit
2020-04-02 23:03                   ` Thomas Gleixner
2020-04-02 23:08                   ` Steven Rostedt
2020-04-02 23:16                     ` Kenneth R. Crudup
2020-04-02 23:18                       ` Jim Mattson
2020-04-03 12:16                         ` Thomas Gleixner
2020-04-10 10:23     ` [PATCH 0/3] x86: KVM: VMX: Add basic split-lock #AC handling Paolo Bonzini
2020-04-10 11:14       ` Thomas Gleixner
2020-04-02 13:43 ` [patch 0/2] x86: Prevent Split-Lock-Detection wreckage on VMX hypervisors Kenneth R. Crudup
2020-04-02 14:32   ` Peter Zijlstra
2020-04-02 14:41     ` Kenneth R. Crudup
2020-04-02 14:46       ` Peter Zijlstra
2020-04-02 14:53         ` Kenneth R. Crudup
2020-04-02 14:37   ` Thomas Gleixner
2020-04-02 14:47     ` Nadav Amit
2020-04-02 15:11       ` Peter Zijlstra
2020-04-02 14:53 [patch 1/2] x86,module: Detect VMX modules and disable Split-Lock-Detect Andy Lutomirski
2020-04-02 15:02 ` Kenneth R. Crudup
2020-04-02 16:46   ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=737F6739-9B8B-4C73-91D3-B873D5780F5E@amacapital.net \
    --to=luto@amacapital.net \
    --cc=fenghua.yu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jannh@google.com \
    --cc=jeyu@kernel.org \
    --cc=keescook@chromium.org \
    --cc=kenny@panix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namit@vmware.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=rostedt@goodmis.org \
    --cc=sean.j.christopherson@intel.com \
    --cc=tglx@linutronix.de \
    --cc=thellstrom@vmware.com \
    --cc=tony.luck@intel.com \
    --cc=vbox-dev@virtualbox.org \
    --cc=x86@kernel.org \
    --cc=xiaoyao.li@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).