Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4583591pxj; Wed, 12 May 2021 08:40:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqZbnY8t5fhBXGO9InEt8K40tD7G+4jeoAtLmO53QTXugLXMqw0yV2hM/Lr+9GvxNVGXzr X-Received: by 2002:a17:906:c010:: with SMTP id e16mr38819022ejz.214.1620834022271; Wed, 12 May 2021 08:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620834022; cv=none; d=google.com; s=arc-20160816; b=uSk9J5HrPg9jzV5JZhoW/yqxnsHWMXLGpR6fVdNRd23VM+r9XbjpoDGChM0GyNnUNs +PbxJUSigtEBVmKeN7TOnrWQmTo7L8CFlNNZjxBNvx91MAk5QSBrrewh9aS+rJZkGx3t +S8ZTjTCurZ7ArmsP8D4E1DNwXOzNbDMqyh0MOydjO34pgAIwa1g1DbuqeLc5cRvIre9 cCmpdDdnVytfYGc0Lp3VSDIb6o6DLoUGhsPNRc38/d+GcN8oR+9MzUds7vBEaj+LvGFb 5eHzUF+mPP8TOd/cW+0aDOiKQo/rloCj9yxj9Qmj1TEInAydC3zclpB/qKuuO5PwzZ29 reIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=n5TUbQlDbhl0G50DDhmPy6Zgt3kUHGJap778l8lUUiQ=; b=1J7JsL+dq9GH3wgsVtPSQYrP7YnJpeW3FF71CEgxLpsshZZPwHY7TaBk4y7swL4mQe pfcXKLz55eaBikAq12ZBDeVHnYuh4bVmcjrIeZru562/zkjWi+wzuHYQwGrPfeBl/Grv uKfKlGy8XkIH3mj0Nnsrwg0NBItTxiWd1LEIThCDxxrMtvQ3QZfGtqVUf8sEPJ2b4mU2 bmOBkdgAz1vyzxKQtSqStGwvfhZvdpjRRNEJBtoe4EsY+r7Py/D88oKHGaq1vj8f1RUS hpVpPdxrBSGcXo8nSveEU494QnA8WZDzeBXh20TCm5E7LWnDCDFZHOMWvDmmuxaPKCHe 7/VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SLUR1+Og; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hq17si193717ejc.641.2021.05.12.08.39.56; Wed, 12 May 2021 08:40:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SLUR1+Og; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236340AbhELPhr (ORCPT + 99 others); Wed, 12 May 2021 11:37:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:46840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234387AbhELPQp (ORCPT ); Wed, 12 May 2021 11:16:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 726C161984; Wed, 12 May 2021 15:06:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620831996; bh=We+e0+6XdnSZadJkQpGugGYHFnalGV1+ozNugpcftjo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SLUR1+Og5LiWELQRZKcNfBZRpoWmTfsQwzRxgNJzOzcADlOgxX6d7yfu1YzhYTa/+ UTv0FX9TA03Ru82qqYBcxWJEmHDMpUixz96f51a6LeI3nJJLz4b7iel77r10WQ5UJ4 jAsIsJYCEPvSZVZ6luP01tfSGKXwT2RAKJKYGwPM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Christopherson , Paolo Bonzini Subject: [PATCH 5.10 098/530] KVM: nVMX: Truncate bits 63:32 of VMCS field on nested check in !64-bit Date: Wed, 12 May 2021 16:43:28 +0200 Message-Id: <20210512144823.023222610@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Christopherson commit ee050a577523dfd5fac95e6cc182ebe0293ead59 upstream. Drop bits 63:32 of the VMCS field encoding when checking for a nested VM-Exit on VMREAD/VMWRITE in !64-bit mode. VMREAD and VMWRITE always use 32-bit operands outside of 64-bit mode. The actual emulation of VMREAD/VMWRITE does the right thing, this bug is purely limited to incorrectly causing a nested VM-Exit if a GPR happens to have bits 63:32 set outside of 64-bit mode. Fixes: a7cde481b6e8 ("KVM: nVMX: Do not forward VMREAD/VMWRITE VMExits to L1 if required so by vmcs12 vmread/vmwrite bitmaps") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20210422022128.3464144-6-seanjc@google.com> Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/vmx/nested.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -5724,7 +5724,7 @@ static bool nested_vmx_exit_handled_vmcs /* Decode instruction info and find the field to access */ vmx_instruction_info = vmcs_read32(VMX_INSTRUCTION_INFO); - field = kvm_register_read(vcpu, (((vmx_instruction_info) >> 28) & 0xf)); + field = kvm_register_readl(vcpu, (((vmx_instruction_info) >> 28) & 0xf)); /* Out-of-range fields always cause a VM exit from L2 to L1 */ if (field >> 15)