Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1110170pxx; Tue, 27 Oct 2020 08:28:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeEmVo5UU2Piat+t/Xq7VfJxjlx9+K+ama6fgxTGCQS1toIIlpBxeHtwc5sf8+nOSYJNZD X-Received: by 2002:a17:906:1618:: with SMTP id m24mr3088436ejd.438.1603812492080; Tue, 27 Oct 2020 08:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603812492; cv=none; d=google.com; s=arc-20160816; b=yc0oao3P6hq56mSfz+LsT4gMJOM94NANUAtDYRPFj0p/WYuYR93uR43Jwo/068Udu9 lLusFXCedDsCaJPaokfZZ1Wam4XFztinvvnLEyyRWKV1hvpAogUA4Ee2EO+qzncfvp+G 6HLCk9YkJs8Zudjba4rRKCwBXGVO/9zBQYf2RIMkZ+Vx6WnK27WG47bpcbxgc3hxjUPT BqYBYiM35nL5u1dpSQR3PfP3v2IAbGRaPXoAS/kL32Qrz/DO7AaAwvV+Kb36CKQARmGO ljwury8G9EQwdh1ig37yrBgtULZ3SZz7w6QUlsDc7GDOzPl7hOa9gPN36R2lamWTlVad 2imw== 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=1eHIz1JY7tP6XBFtstc5D44zo4GeBirGl+UNTdHRCZ8=; b=szg6RcCQH9qgFVRpdPX+yY27dNMVpuFC2MkFP+qEp0Nmt60oeDHp9pzYUvPu7EHdjQ D9g+z6pTPxGEG0WQqUVfamWy0u55TD5Sd/gaw/am8UB0u1JPvgYpIhOlfkv/I4XwaARS 7KzvewEoeyHacn2wiyojPn5lB/ZapnyA3biq6m0vBqtq0HNocsOnAnk/jVvvJTw4ZAHD wofWAgfag4d17MdoFicejsALifAsBv0n+j+wtA+V5bG2Ij0CLlL1py5kcQ6HGyIMV+// EhsO6cIUB5yeY5NOPOv6Wo3NXwsHYpw3c1wHvLgbyTgEzlpVxVQXbIGqJBZ2d5Eq9z5O DgkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rLRL3ZGc; 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=fail (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 y20si1115075edv.92.2020.10.27.08.27.49; Tue, 27 Oct 2020 08:28:12 -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=@kernel.org header.s=default header.b=rLRL3ZGc; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2897779AbgJ0Od1 (ORCPT + 99 others); Tue, 27 Oct 2020 10:33:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:57952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2902189AbgJ0ObP (ORCPT ); Tue, 27 Oct 2020 10:31:15 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 C441C20754; Tue, 27 Oct 2020 14:31:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809075; bh=2kuZP5vndc47XkvVWqZbxCy/vUYb5FUlMMklHag2ST0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rLRL3ZGc6RAmzLdvIdx+0lvw6nEoCV4LRQGRlkN2GvuNBrEvyFCTaucFZjc+QjBgt bxN5pXF1A3f7Ft5uthfcsk6C8wgo1nMSwx56j98PRo9niCwVFCaWuOV/wpsVReKcga kOdQzCfEneWz7GV6Ck97uw4gzurl2BVJJgW3ADxs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Cross , Jim Mattson , Peter Shier , Sean Christopherson , Paolo Bonzini Subject: [PATCH 5.4 049/408] KVM: nVMX: Reload vmcs01 if getting vmcs12s pages fails Date: Tue, 27 Oct 2020 14:49:47 +0100 Message-Id: <20201027135457.341683029@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 b89d5ad00e789967a5e2c5335f75c48755bebd88 upstream. Reload vmcs01 when bailing from nested_vmx_enter_non_root_mode() as KVM expects vmcs01 to be loaded when is_guest_mode() is false. Fixes: 671ddc700fd08 ("KVM: nVMX: Don't leak L1 MMIO regions to L2") Cc: stable@vger.kernel.org Cc: Dan Cross Cc: Jim Mattson Cc: Peter Shier Signed-off-by: Sean Christopherson Message-Id: <20200923184452.980-3-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/vmx/nested.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -3096,8 +3096,10 @@ enum nvmx_vmentry_status nested_vmx_ente prepare_vmcs02_early(vmx, vmcs12); if (from_vmentry) { - if (unlikely(!nested_get_vmcs12_pages(vcpu))) + if (unlikely(!nested_get_vmcs12_pages(vcpu))) { + vmx_switch_vmcs(vcpu, &vmx->vmcs01); return NVMX_VMENTRY_KVM_INTERNAL_ERROR; + } if (nested_vmx_check_vmentry_hw(vcpu)) { vmx_switch_vmcs(vcpu, &vmx->vmcs01);