From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: nVMX MSR load/store feature Date: Mon, 15 Dec 2014 13:10:44 +0100 Message-ID: <548ECFC4.2000607@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Eugene Korenevsky , Jan Kiszka , Bandan Das , kvm@vger.kernel.org, =?UTF-8?B?UmFkaW0gS3LEjQ==?= =?UTF-8?B?bcOhxZk=?= , Wanpeng Li Return-path: Received: from mail-wi0-f171.google.com ([209.85.212.171]:47123 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751341AbaLOMKt (ORCPT ); Mon, 15 Dec 2014 07:10:49 -0500 Received: by mail-wi0-f171.google.com with SMTP id bs8so8626666wib.10 for ; Mon, 15 Dec 2014 04:10:48 -0800 (PST) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 14/12/2014 02:17, Eugene Korenevsky wrote: > Hi there, > > Please DO NOT take v3 version of patchset in account. It contains bug > (missing check for MSR load/store area size in > `nested_vmx_check_msr_switch`). This bug has been fixed in v4 version > of patchset. The diff is just diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index d6fe958a0403..09ccf6c09435 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -8305,6 +8305,8 @@ static int nested_vmx_check_msr_switch(struct kvm_vcpu *vcpu, WARN_ON(1); return -EINVAL; } + if (count == 0) + return 0; if (!IS_ALIGNED(addr, 16) || addr >> maxphyaddr || (addr + count * sizeof(struct vmx_msr_entry) - 1) >> maxphyaddr) { pr_warn_ratelimited( right? Paolo