linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: "Christoffer Dall" <christoffer.dall@linaro.org>,
	"Marc Zyngier" <marc.zyngier@arm.com>,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"James Hogan" <james.hogan@imgtec.com>,
	"Paul Mackerras" <paulus@samba.org>,
	kernel-hardening@lists.openwall.com,
	"Kees Cook" <keescook@chromium.org>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Subject: [PATCH v2 0/2] KVM: fixes for the kernel-hardening tree
Date: Thu, 26 Oct 2017 15:45:45 +0200	[thread overview]
Message-ID: <20171026134547.23664-1-pbonzini@redhat.com> (raw)

Four KVM ioctls (KVM_GET/SET_CPUID2 on x86, KVM_GET/SET_ONE_REG on
ARM and s390) directly access the kvm_vcpu_arch struct.  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 on those architectures.

The kvm_vcpu_arch struct is embedded in the kvm_vcpu struct and the
corresponding slab cache is allocated by architecture-independent code.
It is enough, for simplicity, to whitelist the whole sub-struct and
only touch one place of the KVM code.  Later, any further restrictions
can be applied in the KVM tree.

Paolo Bonzini (2):
  kvm: whitelist struct kvm_vcpu_arch
  kvm: x86: fix KVM_XEN_HVM_CONFIG ioctl

 arch/x86/kvm/x86.c  | 7 ++++---
 virt/kvm/kvm_main.c | 8 ++++++--
 2 files changed, 10 insertions(+), 5 deletions(-)

-- 
2.14.2

             reply	other threads:[~2017-10-26 13:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26 13:45 Paolo Bonzini [this message]
2017-10-26 13:45 ` [PATCH 1/2] kvm: whitelist struct kvm_vcpu_arch Paolo Bonzini
2017-10-26 14:13   ` Cornelia Huck
2017-10-26 14:21   ` Christoffer Dall
2017-10-26 14:34   ` Marc Zyngier
2017-10-26 14:51   ` Christian Borntraeger
2017-10-30 23:28   ` [kernel-hardening] " Eric Biggers
2017-10-30 23:51     ` Kees Cook
2017-10-26 13:45 ` [PATCH 2/2] kvm: x86: fix KVM_XEN_HVM_CONFIG ioctl Paolo Bonzini
2017-10-26 13:48   ` Kees Cook
2017-11-30 20:40   ` Kees Cook
2017-12-01  8:29     ` Paolo Bonzini
2017-10-27  5:25 ` [PATCH v2 0/2] KVM: fixes for the kernel-hardening tree Paul Mackerras

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=20171026134547.23664-1-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=cohuck@redhat.com \
    --cc=james.hogan@imgtec.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=paulus@samba.org \
    --cc=rkrcmar@redhat.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).