All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 0/2] x86: Prevent Split-Lock-Detection wreckage on VMX hypervisors
@ 2020-04-02 12:32 Thomas Gleixner
  2020-04-02 12:32 ` [patch 1/2] x86,module: Detect VMX modules and disable Split-Lock-Detect Thomas Gleixner
                   ` (2 more replies)
  0 siblings, 3 replies; 81+ messages in thread
From: Thomas Gleixner @ 2020-04-02 12:32 UTC (permalink / raw)
  To: LKML
  Cc: x86, Kenneth R. Crudup, Peter Zijlstra (Intel),
	Paolo Bonzini, Jessica Yu, Fenghua Yu, Xiaoyao Li, Nadav Amit,
	Thomas Hellstrom, Sean Christopherson, Tony Luck, Steven Rostedt

Kenneth reported that a VMWare guest crashes in the VMWare BIOS due to a
Split-Lock induced #AC which is injected by the VMWare hypervisor into the
guest.

While this is a good thing in principle, it's not really practical.
That means that Split-Lock-Detection has to be disabled when any
unprepared VMX hypervisor is loaded.

As hypervisor modules are not really identifiable, the only safe solution
we came up with is to scan the module text at load time for a VMLAUNCH
instruction. If VMLAUNCH is found then Split-Lock-Detection is disabled on
the host to prevent the above. If the hypervisor has at least minimal
handling code, the module can tell the kernel by adding MOD_INFO(sld_safe,
"Y") which disables the text scan.

For KVM it's simple enough to handle it at least at the basic level by
checking guest CR0.AM and EFLAGS.AC state and a trivial host side
handler which depending on the SLD mode handles it gracefully or tells
the VMX handler to deliver the #AC to user space which then can crash
and burn itself.

As Peter and myself don't have access to a SLD enabled machine, the
KVM/VMX part is untested. The module scan part works.

Alternatively we can obviously revert SLD, but that does not make the
problem vs. out of tree hypervisors go away magically. So we can just
get over it now.

Thanks,

	tglx




^ permalink raw reply	[flat|nested] 81+ messages in thread
* Re: [patch 1/2] x86,module: Detect VMX modules and disable Split-Lock-Detect
@ 2020-04-02 14:53 Andy Lutomirski
  2020-04-02 15:02 ` Kenneth R. Crudup
  0 siblings, 1 reply; 81+ messages in thread
From: Andy Lutomirski @ 2020-04-02 14:53 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, x86, Kenneth R. Crudup, Peter Zijlstra (Intel),
	Paolo Bonzini, Jessica Yu, Fenghua Yu, Xiaoyao Li, Nadav Amit,
	Thomas Hellstrom, Sean Christopherson, Tony Luck, Steven Rostedt


> On Apr 2, 2020, at 6:01 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> 

This seems like much more of a fixup than we would usually do for out-of-tree modules.  How about just refusing to load the offending module?

^ permalink raw reply	[flat|nested] 81+ messages in thread

end of thread, other threads:[~2020-04-10 11:15 UTC | newest]

Thread overview: 81+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2020-04-03 21:49             ` Thomas Gleixner
2020-04-03 11:29   ` kbuild test robot
2020-04-03 11:29     ` [patch 1/2] x86, module: " kbuild test robot
2020-04-03 14:43   ` [patch 1/2] x86,module: " kbuild test robot
2020-04-03 14:43     ` [patch 1/2] x86, module: " kbuild test robot
2020-04-03 16:36   ` [patch 1/2] x86,module: " 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.