All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: fixes for the kernel-hardening tree
@ 2017-10-20 23:25 ` Paolo Bonzini
  0 siblings, 0 replies; 43+ messages in thread
From: Paolo Bonzini @ 2017-10-20 23:25 UTC (permalink / raw)
  To: linux-kernel, kvm
  Cc: kernel-hardening, Kees Cook, Radim Krčmář,
	Christoffer Dall, Marc Zyngier, Christian Borntraeger,
	Cornelia Huck, James Hogan, Paul Mackerras

Two KVM ioctls (KVM_GET/SET_CPUID2) directly access the cpuid_entries
field of struct kvm_vcpu_arch.  Therefore, the new usercopy hardening
work in linux-next, which forbids copies from and to slab objects
unless they are from kmalloc or explicitly whitelisted, breaks KVM
completely.

This series fixes it by adding the two new usercopy arguments
to kvm_init (more precisely to a new function kvm_init_usercopy,
while kvm_init passes zeroes as a default).

There's also another broken ioctl, KVM_XEN_HVM_CONFIG, but it is
obsolete and not a big deal at all.

I'm Ccing all submaintainers in case they have something similar
going on in their kvm_arch and kvm_vcpu_arch structs.  KVM has a
pretty complex userspace API, so thorough with linux-next is highly
recommended.

Many thanks to Thomas Gleixner for reporting this to me.

Paolo

Paolo Bonzini (2):
  KVM: allow setting a usercopy region in struct kvm_vcpu
  KVM: fix KVM_XEN_HVM_CONFIG ioctl

 arch/x86/include/asm/kvm_host.h |  3 +++
 arch/x86/kvm/svm.c              |  4 ++--
 arch/x86/kvm/vmx.c              |  4 ++--
 arch/x86/kvm/x86.c              | 17 ++++++++++++++---
 include/linux/kvm_host.h        | 13 +++++++++++--
 virt/kvm/kvm_main.c             | 13 ++++++++-----
 6 files changed, 40 insertions(+), 14 deletions(-)

-- 
2.14.2

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

end of thread, other threads:[~2017-10-25 10:31 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-20 23:25 [PATCH 0/2] KVM: fixes for the kernel-hardening tree Paolo Bonzini
2017-10-20 23:25 ` [kernel-hardening] " Paolo Bonzini
2017-10-20 23:25 ` [PATCH 1/2] KVM: allow setting a usercopy region in struct kvm_vcpu Paolo Bonzini
2017-10-20 23:25   ` [kernel-hardening] " Paolo Bonzini
2017-10-21 14:53   ` Kees Cook
2017-10-21 14:53     ` [kernel-hardening] " Kees Cook
2017-10-20 23:25 ` [PATCH 2/2] KVM: fix KVM_XEN_HVM_CONFIG ioctl Paolo Bonzini
2017-10-20 23:25   ` [kernel-hardening] " Paolo Bonzini
2017-10-21 18:45 ` [PATCH] KVM: arm/arm64: Allow usercopy to vcpu->arch.ctxt and arm64 debug Christoffer Dall
2017-10-21 18:45   ` [kernel-hardening] " Christoffer Dall
2017-10-21 18:45   ` Christoffer Dall
2017-10-22  3:06   ` Kees Cook
2017-10-22  3:06     ` [kernel-hardening] " Kees Cook
2017-10-22  3:06     ` Kees Cook
2017-10-22  7:44     ` Christoffer Dall
2017-10-22  7:44       ` [kernel-hardening] " Christoffer Dall
2017-10-22  7:44       ` Christoffer Dall
2017-10-23 14:14       ` Paolo Bonzini
2017-10-23 14:14         ` [kernel-hardening] " Paolo Bonzini
2017-10-23 14:14         ` Paolo Bonzini
2017-10-23 14:49         ` Christoffer Dall
2017-10-23 14:49           ` [kernel-hardening] " Christoffer Dall
2017-10-23 14:49           ` Christoffer Dall
2017-10-23 19:40         ` Kees Cook
2017-10-23 19:40           ` [kernel-hardening] " Kees Cook
2017-10-23 19:40           ` Kees Cook
2017-10-23 21:06           ` R: " Paolo Bonzini
2017-10-23 21:06             ` [kernel-hardening] " Paolo Bonzini
2017-10-23 21:06             ` Paolo Bonzini
2017-10-22  7:48 ` [PATCH v2] " Christoffer Dall
2017-10-22  7:48   ` Christoffer Dall
2017-10-23  9:52 ` [PATCH 0/2] KVM: fixes for the kernel-hardening tree David Hildenbrand
2017-10-23  9:52   ` [kernel-hardening] " David Hildenbrand
2017-10-23 11:10   ` Christian Borntraeger
2017-10-23 11:10     ` [kernel-hardening] " Christian Borntraeger
2017-10-23 12:39   ` Cornelia Huck
2017-10-23 12:39     ` [kernel-hardening] " Cornelia Huck
2017-10-23 14:15     ` Paolo Bonzini
2017-10-23 14:15       ` [kernel-hardening] " Paolo Bonzini
2017-10-25  9:45       ` David Hildenbrand
2017-10-25  9:45         ` [kernel-hardening] " David Hildenbrand
2017-10-25 10:31         ` Christian Borntraeger
2017-10-25 10:31           ` [kernel-hardening] " Christian Borntraeger

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.