Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2088767ybp; Thu, 10 Oct 2019 02:00:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6eLc495PZBRZFRucHMB9tYLwRsCgBDPm/D3VXImcBUH2LOy5UepM4TivdvNXjP3eVNkrt X-Received: by 2002:a50:d556:: with SMTP id f22mr6942724edj.248.1570698025094; Thu, 10 Oct 2019 02:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570698025; cv=none; d=google.com; s=arc-20160816; b=bMsdrePrI+kXBNbmpdInUn2XTycF3KzaEhlS9gRm38sZ3C0p207a8m/4a1VYoo7HrD jPJCyZTtm/qm5SSM0+k644zlDRYfoT5GofcWjuWGo4yaNsyhm9zdMPRPLX/nYPnW8LoK UfHP6/ez92Armrv0bG27PXQY5tt9WygCxQqLLywTvuC2T1J3xkveMek3tW6+gzpkYXBU kS3qRevPa60lEHP1jG0/HYkSl82mxw/6KQuhRsfZz9hAiuGKlRS5Ibm1xeQySTGhTGoc Yq1uKe8JjGeBEjJTQRoSSDaJT0+06Qs0qJWN8QXbolPIa5iqy/KtX8oCsTa8zUaB6tOX d2YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xbhfr+1k+tz01A4zE/WsFzsMdMFu/gSsk+PJffyP+xI=; b=YYOd9YcSgvZLb6JnLNozf1FGCtxTIEh/xxswOXoZPzYN2l3QE404OD3p3epubkE/b4 tAZorypJFPw47I3lq787NKQ8jgxT3ISLW6fOrQCi9OL5uL8I91KwbU5wCWXT0u06rV2/ UZXPiXrW3WifeqLb3K4JPq4Yff72Q8D0haNdPRVv2xs4YdfXhrd7y9wxERhUN/biN/gC wFCeL/KTQzFXybSBVun+b7bnK7q31DOYhOtmcR7kgW9GBT7Pch6DdRgCEcto5vTX8eHE Xle+i3Fy4IEuHkMxm9IG+3yQa3JmJjiFy48B8MCOWok5WjKZez92sbJizJ/jfqMYEjx+ Y71A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UlXBi0+P; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d19si2620924ejy.353.2019.10.10.02.00.01; Thu, 10 Oct 2019 02:00:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UlXBi0+P; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388816AbfJJI7z (ORCPT + 99 others); Thu, 10 Oct 2019 04:59:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:48458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388759AbfJJIng (ORCPT ); Thu, 10 Oct 2019 04:43:36 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 13BB121929; Thu, 10 Oct 2019 08:43:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570697015; bh=PMFljwLuGJXhVsdndEYQp6wTHEoqjTGybZ1dfjdUdx0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UlXBi0+PshpIOsY47HeXwVPFf7ddqJ2g9JV1XA0UDoj9KfYyx7zFNCNVbeg9alO6G wJ2zoRsFU6QkGomy2snUMkxEqm8+4J/shePvs1zuvi4FbwVNz0WOZVj5wu+HXNkzDd kEUGlPM58+I2XrjIG2LDo2JtYiVc64aCNmF0+uQE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nadav Amit , Sean Christopherson , Jim Mattson , Paolo Bonzini , Sasha Levin Subject: [PATCH 5.3 137/148] KVM: nVMX: Fix consistency check on injected exception error code Date: Thu, 10 Oct 2019 10:36:38 +0200 Message-Id: <20191010083620.661115143@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083609.660878383@linuxfoundation.org> References: <20191010083609.660878383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Christopherson [ Upstream commit 567926cca99ba1750be8aae9c4178796bf9bb90b ] Current versions of Intel's SDM incorrectly state that "bits 31:15 of the VM-Entry exception error-code field" must be zero. In reality, bits 31:16 must be zero, i.e. error codes are 16-bit values. The bogus error code check manifests as an unexpected VM-Entry failure due to an invalid code field (error number 7) in L1, e.g. when injecting a #GP with error_code=0x9f00. Nadav previously reported the bug[*], both to KVM and Intel, and fixed the associated kvm-unit-test. [*] https://patchwork.kernel.org/patch/11124749/ Reported-by: Nadav Amit Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Reviewed-by: Jim Mattson Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin --- arch/x86/kvm/vmx/nested.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index a3cba321b5c5d..61aa9421e27af 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -2584,7 +2584,7 @@ static int nested_check_vm_entry_controls(struct kvm_vcpu *vcpu, /* VM-entry exception error code */ if (has_error_code && - vmcs12->vm_entry_exception_error_code & GENMASK(31, 15)) + vmcs12->vm_entry_exception_error_code & GENMASK(31, 16)) return -EINVAL; /* VM-entry interruption-info field: reserved bits */ -- 2.20.1