Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3696185ybv; Mon, 10 Feb 2020 04:53:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwt6wId2F+Z6zWASJ7NJVxWlDpVtfBh5WiPqt3maa3L9pdOTJMnin37Llku9syI4hSQ9g0S X-Received: by 2002:aca:f08:: with SMTP id 8mr749933oip.60.1581339217871; Mon, 10 Feb 2020 04:53:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581339217; cv=none; d=google.com; s=arc-20160816; b=BKw4VbkcMZDsfVCsudGITexpbOZ3U7T3mPf87IeRbUu/cPft/2ac2fKHYG33c+phXm wbjeY1R+zAFk792hGNXOZ8e9x5DlLTTu5P98wc4v800+pWGIFK/0pJMymrqyFf9qgFne EQMHD/Pp9YFRE+e23WySgw4OIUP01m0DX0MGVQJ+6+22b9Qdth26hLRZ1EsTJMKlucaw JhQ5slS8dd4rUGdTsZ7+IaZ7My4pgHotNe2Er1/Yz3QWZXt5BZk6FsqOoCLMMmYcBKhN B9Bc2OobNd5Sj8U+WT93MuSskp+F+wuT7ZyJCp/Pl9HcNvXcHTi9mE5dSMw/3+K9BQhP SDRA== 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=lvzrv7apjv4B8nGv8Q8LH/4OdSAxILjCtFHWcNkmOGI=; b=eSxVXrqqHAPyGVIf1AwkZBFepJr3j3+t8pZZqZjzlXTyHKSdHGttSRZ24DNNzbSBuz hpRmyYRXyqELe/4eNGnsah2fNaif7rj5W9m7+owk+5yTkEbRiXjdQ9Qf3oTj3ZeJjgTf Wsr5oQSr0xvp44oHJGTHLqvC/XbYqeSBzneHZxVyUtVkQCb6Tjhz7VIZEb0T7B08eRVd UCjl6kE2VQ7k7w8Ar9Jp4pIuCl4+PkiKfje4wU+QfZuf4ehraTo4V3+zP1VLQMIjKNIh pv6hva61P51SAEzDqC3wjvK/4gvgxV1l1RYsm6yM21BrYGTdiPHOGyjuGT/wkYY/kszY jU5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GiYALMHR; 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 r1si135527ota.259.2020.02.10.04.53.25; Mon, 10 Feb 2020 04:53:37 -0800 (PST) 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=GiYALMHR; 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 S1729596AbgBJMxU (ORCPT + 99 others); Mon, 10 Feb 2020 07:53:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:45926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730183AbgBJMmM (ORCPT ); Mon, 10 Feb 2020 07:42:12 -0500 Received: from localhost (unknown [209.37.97.194]) (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 1C81320838; Mon, 10 Feb 2020 12:42:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338532; bh=mUM/kUTuheMEU5s0EMgtV8p8tBKS0IMx5NwaDt9nmXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GiYALMHRhz8wGg+8hfN1al48md5+Xt3iqLMexxhPHkPQK0z1Q9rg8rTkD2rHjhFuI RXOB9vX54iPgb6oeqjxXMBmo3Kt+XvUKN2wXHpuHZGojyetVeCqIWpCjAPpkyg4WlM RPdXogvZsz9/EyUCZbpCWU7Fvr4WqU1ScRvNNHLE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liran Alon , Miaohe Lin , Sean Christopherson , Paolo Bonzini , Sasha Levin Subject: [PATCH 5.5 357/367] KVM: nVMX: vmread should not set rflags to specify success in case of #PF Date: Mon, 10 Feb 2020 04:34:30 -0800 Message-Id: <20200210122455.380067506@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@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: Miaohe Lin [ Upstream commit a4d956b9390418623ae5d07933e2679c68b6f83c ] In case writing to vmread destination operand result in a #PF, vmread should not call nested_vmx_succeed() to set rflags to specify success. Similar to as done in VMPTRST (See handle_vmptrst()). Reviewed-by: Liran Alon Signed-off-by: Miaohe Lin Cc: stable@vger.kernel.org Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin --- arch/x86/kvm/vmx/nested.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index 4aea7d304bebd..5bfa8228f0c74 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -4807,8 +4807,10 @@ static int handle_vmread(struct kvm_vcpu *vcpu) vmx_instruction_info, true, len, &gva)) return 1; /* _system ok, nested_vmx_check_permission has verified cpl=0 */ - if (kvm_write_guest_virt_system(vcpu, gva, &field_value, len, &e)) + if (kvm_write_guest_virt_system(vcpu, gva, &field_value, len, &e)) { kvm_inject_page_fault(vcpu, &e); + return 1; + } } return nested_vmx_succeed(vcpu); -- 2.20.1