Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4584010pxj; Wed, 12 May 2021 08:40:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwd2VLos9ZJ4Hieb64IuG9HrCWbC1mYYxYYft0PsljZf/sZstXjorvBNQdczG1rbLkGX20y X-Received: by 2002:a9d:5552:: with SMTP id h18mr22150159oti.104.1620834055002; Wed, 12 May 2021 08:40:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620834054; cv=none; d=google.com; s=arc-20160816; b=YCSU8aqUo6/BTcFZ3MLpLjTfuPJVhFYfJ+dJe5E9iSI2haDySvdy3tl57MgOeJQaF7 E+VzhEmE2z2XVy3vHbkWAoJ9LMrR4/9XGY0CPTkkrZADEK16ez/8QkA6oEiXTGSdv666 G2a/ijqSfWdTGwn+GHNzm5RYEPUp0dGv83SxjRcqvam9IeL3JMoxIpoy5K/Ctw3qQlqR AgliNh2FVi4VTaTdORrcjv/O1/My6XNZNsdVRGICMVlhxKRaSyM6iacTtpbwkVN4qwpU fLhZKoR+VnuVmlsoHs6Psg3SwhSkkTM/j2djG3bq9gWj2XKj9PvtzKM9uMUz6bCL9QoG RPuw== 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=7UyWOBw3rQqt+yfVrg8LJVt9WageNLs+AxVKSU8Hg3I=; b=XdgfStvYR2Z6S6PwSMQj3nliHXALvHd58liVfYtLcf3GgmuSAI2+BI0xxMRmSdVWbs 9k64rqnaMAb7wxH9qobPNOqIwIsaLT4tLtjTei8Mox1lz9ejsSVgh7PbMspZdG6yYRlD v69EA0rcfSdhpKcNbbAbv5axLlQ4GRMQG+08KT359XvszjI7EDS08upHx9CK8E+GXiog deeVHioCvKyo+0F0YV+ZrXqbZytii3VZMqWfxIadJmpGjB4Wb7Bobb6fA58/u3ou07CK G2kL8pLTMN1+hffvXmipfscEHSfwvAZ5BWu3G7rRGEBDn1UfL8akHKPRkQWlUJ5Z804M w/Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=thjnQlzn; 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 c6si278207otu.56.2021.05.12.08.40.41; Wed, 12 May 2021 08:40:54 -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=thjnQlzn; 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 S236364AbhELPhs (ORCPT + 99 others); Wed, 12 May 2021 11:37:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:50356 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234388AbhELPQq (ORCPT ); Wed, 12 May 2021 11:16:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D17536143D; Wed, 12 May 2021 15:06:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620831999; bh=kKRTqiCKxEZOJvZCTcd+m9uqYXJSOUwtTAfECzwj4KQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=thjnQlznfay/h4GlwDoeIBgMkbmUHpJFo25P1ona9wsbQVl4MWVPelohy8ktOTuyq DTLZNuoY8VLdyClE7hS7DEIU1q1+gqJi4jkwnhEHNYC+hJK/Lo0d9fS7sW93xX6JFs vvplgZYqRQslVBOL1MJEIEA0pkA6mYf34Lxj2Ias= 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 099/530] KVM: nVMX: Truncate base/index GPR value on address calc in !64-bit Date: Wed, 12 May 2021 16:43:29 +0200 Message-Id: <20210512144823.056214058@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 82277eeed65eed6c6ee5b8f97bd978763eab148f upstream. Drop bits 63:32 of the base and/or index GPRs when calculating the effective address of a VMX instruction memory operand. Outside of 64-bit mode, memory encodings are strictly limited to E*X and below. Fixes: 064aea774768 ("KVM: nVMX: Decoding memory operands of VMX instructions") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20210422022128.3464144-7-seanjc@google.com> Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/vmx/nested.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -4613,9 +4613,9 @@ int get_vmx_mem_address(struct kvm_vcpu else if (addr_size == 0) off = (gva_t)sign_extend64(off, 15); if (base_is_valid) - off += kvm_register_read(vcpu, base_reg); + off += kvm_register_readl(vcpu, base_reg); if (index_is_valid) - off += kvm_register_read(vcpu, index_reg) << scaling; + off += kvm_register_readl(vcpu, index_reg) << scaling; vmx_get_segment(vcpu, &s, seg_reg); /*