Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4557940imu; Tue, 29 Jan 2019 03:46:26 -0800 (PST) X-Google-Smtp-Source: ALg8bN7d0f8f88YtHaognOkFsPTbYYQDYjVB/+MjIZRssq4ksnvy8ViA3cl0KGb9mFdvSJ5+IDbe X-Received: by 2002:a62:55c4:: with SMTP id j187mr25720169pfb.129.1548762386527; Tue, 29 Jan 2019 03:46:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548762386; cv=none; d=google.com; s=arc-20160816; b=P+ssDwBBtlXZ64enGXOByWcWIltsa2ZtqwUn/HqewDQeRJKZrwXd+3kNHAX1wGqhjO 3vJmXktFmCpO56KtSbO+mXbrCQnE3qZJuhj93cB0bAhNM4vqIPT3HE5HFsuFuBWi0mhS wjf5PE1B9SNlahscr+ov7htyd+oyrGnkPKNr2yWQnpHyXUH9bMTdPXIh5+iLUYMLIzmF cNosgAYoxFLUDv67/G9HSK5eaX/3OuHqP071MJcUVbTBMmohDymCF54ZH5fncYMGd7dU lQXnPZF/SUsI/VqoAvVj1w1qo24df17F3phrnukNTOFA9lIyRseKSGJuh+5qh9cu+WxQ RIqQ== 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=AZpaX8QfAdYPXdANSOf9nHSZqLa1ydVxtw9lQiVr5Ns=; b=Oy70NfSdHiYC9pGmsA010dfIejA7L4/HGcO4tXXyvmwObiskoIy0z9rwSZYtm+wKBx SPhoKH9OMDrbb7sPmCzgYxHTTnOaG5Mjmb8aEGpEUCSUb1GfgCXyzymaMLjf2Dke7rT4 NTGad4fuyPtFDyzQhfJZJE0AKaoVFXmxlumV6XKrKO4Ut3ZGF5AVPlsbnPCsLSD98qD1 n6qI/09Q/ecMgaRNEhqTYFkQUkRrm5VM6iYsZTiTrBWSi687dDWy9JIHpOKS6ntaXE9h ST90QQb/xavyh7ryt3Ra4dN5oVuTh01O7iMO3JlBgHJzFHmVzLtBgPjb9tCfDULjomNs P2pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QyemBRLU; 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 g22si34654112pfj.222.2019.01.29.03.46.11; Tue, 29 Jan 2019 03:46:26 -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=QyemBRLU; 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 S1730352AbfA2Lpi (ORCPT + 99 others); Tue, 29 Jan 2019 06:45:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:35960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730777AbfA2Lpb (ORCPT ); Tue, 29 Jan 2019 06:45:31 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 C5D7020882; Tue, 29 Jan 2019 11:45:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548762330; bh=k4LT62um8fDMfwwIYU1HAUpcq/tcyMVMj64I1TSft+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QyemBRLU4sfBu7Dix2tlB5IYwUB+F5sHT99v2xZdAHcI1NKbo37rGjXd3jQWWFFgL IaVUlJnYyzaaNam226O1kKIIavGqp60TqL6KTKF8yjMdVInzCvkQ+xjCtw99AMG29W A8daQ4aVFui/aLLlEA8nc/e0Mupz6OEF/0nxNZvA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org, KarimAllah Ahmed , Jim Mattson , Krish Sadhuhan Subject: [PATCH 4.19 071/103] KVM/nVMX: Do not validate that posted_intr_desc_addr is page aligned Date: Tue, 29 Jan 2019 12:35:48 +0100 Message-Id: <20190129113204.915630475@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129113159.567154026@linuxfoundation.org> References: <20190129113159.567154026@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: KarimAllah Ahmed commit 22a7cdcae6a4a3c8974899e62851d270956f58ce upstream. The spec only requires the posted interrupt descriptor address to be 64-bytes aligned (i.e. bits[0:5] == 0). Using page_address_valid also forces the address to be page aligned. Only validate that the address does not cross the maximum physical address without enforcing a page alignment. Cc: Paolo Bonzini Cc: Radim Krčmář Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: H. Peter Anvin Cc: x86@kernel.org Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Fixes: 6de84e581c0 ("nVMX x86: check posted-interrupt descriptor addresss on vmentry of L2") Signed-off-by: KarimAllah Ahmed Reviewed-by: Jim Mattson Reviewed-by: Krish Sadhuhan Signed-off-by: Radim Krčmář From: Mark Mielke Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -11733,7 +11733,7 @@ static int nested_vmx_check_apicv_contro !nested_exit_intr_ack_set(vcpu) || (vmcs12->posted_intr_nv & 0xff00) || (vmcs12->posted_intr_desc_addr & 0x3f) || - (!page_address_valid(vcpu, vmcs12->posted_intr_desc_addr)))) + (vmcs12->posted_intr_desc_addr >> cpuid_maxphyaddr(vcpu)))) return -EINVAL; /* tpr shadow is needed by all apicv features. */