Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2662139imj; Mon, 11 Feb 2019 06:39:06 -0800 (PST) X-Google-Smtp-Source: AHgI3IaKwmG7x1SzjnIXrFrfpXlB/7hzrSaErLIvHu6qK7f8T+0UML/fdhxqKnQzVn38Vwfg6ytx X-Received: by 2002:a17:902:7043:: with SMTP id h3mr38023017plt.22.1549895946422; Mon, 11 Feb 2019 06:39:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895946; cv=none; d=google.com; s=arc-20160816; b=Ce+ndDfdHycEtuNsLpJWO57hdA16oRgHA3NM4R3COYGxb/YU2X2ZHsVKKXF8HY/Gkf fOBZe3yoRPAGJlb9k5rXfZelbfIih7q6geSZAfWnuU1q9MQsBki6KwUQJddBps8nVfei n+XS0uO+kqgFEvFuGKWE2XSdPXbD225B5m1F+LZpIm/1opiZr2PiXHV1uZgRb5swz0Nq YscuVX2t5F7llihPtoYrJf7ZXfFrbI6gqmzIRZuy4EaruJ9Na4yWf8GSPaJv5TsOVGZq /lQBM0WcNIO7VcvZWV/nC8rSGbWlxPuMyW3ZXYpGRgZ0B26TBTVW6YnDOUD/NjjYvpgU 5JMA== 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=BFzY10mfy1YxEF5rR/FBl0r9BZPuWjQnO+U6AXbdTg8=; b=TtjNkkkSFLZ3nisub2i9DumfOYxV2A6aeznoT+osKx58RYgP5lZpeYO+EDRD11fE0y u3wNc3KFxx85FAVsjPaBAZS/yOgbar8uXEATKuDGW2IlEXfe33zdBL16/GfLwL/p0gwe 7TQrO7EFht5xoOmCS5M880Mw1BjJvoWxyk19PB/V+XapYEDOExxqMpG71Vau0iH7EhZe 8DtcqIfTTxe9PVZMo8ye3U+Mh5tzHms7OxV9kg6T69G3RFR0KpybXz0DDQgZozdR2jtI ZgT2OaiE0wxUeqXaD5Sfu9CjXCohEH1TeXf9c2QO5MVqeUM11cnvYRR/x0UhbMYQMtOz JRYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="SRWrT/W2"; 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 d65si10390894pfc.201.2019.02.11.06.38.50; Mon, 11 Feb 2019 06:39:06 -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="SRWrT/W2"; 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 S1731571AbfBKOh7 (ORCPT + 99 others); Mon, 11 Feb 2019 09:37:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:47480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728985AbfBKOh5 (ORCPT ); Mon, 11 Feb 2019 09:37:57 -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 30EB12081B; Mon, 11 Feb 2019 14:37:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895876; bh=MmmB28XzmAi//vcpfc0fO/vaPpBDyln/sNL+f939Omo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SRWrT/W2i0XW6c39jgW/8VR/lCBmLqQsRfI1ewL8gogHcdkED6ElJIlnUpyMOZQg1 FqY0nsfsOfdsbmTt8Rc2r5O/th48iW+TB+zjQ5CIZpad1M5i95t/whWXJz4Tki1xBa 1UN2tsDeZuRIG7GyBVZOt0aQtPORoEy1yvo2OZJk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Shier , Jim Mattson , Felix Wilhelm , stable@kernel.org, Paolo Bonzini Subject: [PATCH 4.20 341/352] KVM: nVMX: unconditionally cancel preemption timer in free_nested (CVE-2019-7221) Date: Mon, 11 Feb 2019 15:19:28 +0100 Message-Id: <20190211141908.896613740@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@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.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peter Shier commit ecec76885bcfe3294685dc363fd1273df0d5d65f upstream. Bugzilla: 1671904 There are multiple code paths where an hrtimer may have been started to emulate an L1 VMX preemption timer that can result in a call to free_nested without an intervening L2 exit where the hrtimer is normally cancelled. Unconditionally cancel in free_nested to cover all cases. Embargoed until Feb 7th 2019. Signed-off-by: Peter Shier Reported-by: Jim Mattson Reviewed-by: Jim Mattson Reported-by: Felix Wilhelm Cc: stable@kernel.org Message-Id: <20181011184646.154065-1-pshier@google.com> Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/vmx.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -8509,6 +8509,7 @@ static void free_nested(struct kvm_vcpu if (!vmx->nested.vmxon && !vmx->nested.smm.vmxon) return; + hrtimer_cancel(&vmx->nested.preemption_timer); vmx->nested.vmxon = false; vmx->nested.smm.vmxon = false; free_vpid(vmx->nested.vpid02);