From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 247D8C169C4 for ; Tue, 29 Jan 2019 09:42:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E8C872177E for ; Tue, 29 Jan 2019 09:42:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548754970; bh=KTTMxQ8EBdAV3fysbEiG8hcF8PiXTtCidSZBkV2LioY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=cvLjGywvdUnGK+WH/k4Y/4MZWiC0/nFjCKdQH6I1s23YGjm7aAf0kC2npq4zMPuc+ I7+YfD+po/hzjyKohlFUatxWwy9pQSk+k5rVm1SHZZjLcrUQH13YACasE/88DRSpKG 1Z94B65B1GRtCrlJfiR0qFexiDkqDxGQ9FBQlsmQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727909AbfA2Jmt (ORCPT ); Tue, 29 Jan 2019 04:42:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:40154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726383AbfA2Jmt (ORCPT ); Tue, 29 Jan 2019 04:42:49 -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 4E0342084A; Tue, 29 Jan 2019 09:42:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548754968; bh=KTTMxQ8EBdAV3fysbEiG8hcF8PiXTtCidSZBkV2LioY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=yG7kyxnnUIkd7Ri2Cq3qA9ZWyYhjc0N1OJVZUvOh/ud5j2xR9z8MZfpQGKj5i3WGJ V8MBdRJFTbO1FeDwtK+KPmgTXlajT4bS9gCb6Ryir3yAfTRRoSnOow7BEUbKgeazzT ui2TjUzVN/Kx8Oz3UME1LhOfPpSJtNk4tENxwS3s= Date: Tue, 29 Jan 2019 10:42:46 +0100 From: Greg Kroah-Hartman To: Sean Christopherson Cc: Sasha Levin , kvm@vger.kernel.org, stable@vger.kernel.org, Peter Xu , Rik van Riel , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Thomas Lindroth Subject: Re: [PATCH] KVM: x86: Fix a 4.14 backport regression related to userspace/guest FPU Message-ID: <20190129094246.GB20645@kroah.com> References: <20190128205102.29393-1-sean.j.christopherson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190128205102.29393-1-sean.j.christopherson@intel.com> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Mon, Jan 28, 2019 at 12:51:02PM -0800, Sean Christopherson wrote: > Upstream commit: > > f775b13eedee ("x86,kvm: move qemu/guest FPU switching out to vcpu_run") > > introduced a bug, which was later fixed by upstream commit: > > 5663d8f9bbe4 ("kvm: x86: fix WARN due to uninitialized guest FPU state") > > For reasons unknown, both commits were initially passed-over for > inclusion in the 4.14 stable branch despite being tagged for stable. > Eventually, someone noticed that the fixup, commit 5663d8f9bbe4, was > missing from stable[1], and so it was queued up for 4.14 and included in > release v4.14.79. > > Even later, the original buggy patch, commit f775b13eedee, was also > applied to the 4.14 stable branch. Through an unlucky coincidence, the > incorrect ordering did not generate a conflict between the two patches, > and led to v4.14.94 and later releases containing a spurious call to > kvm_load_guest_fpu() in kvm_arch_vcpu_ioctl_run(). As a result, KVM may > reload stale guest FPU state, e.g. after accepting in INIT event. This > can manifest as crashes during boot, segfaults, failed checksums and so > on and so forth. > > Remove the unwanted kvm_{load,put}_guest_fpu() calls, i.e. make > kvm_arch_vcpu_ioctl_run() look like commit 5663d8f9bbe4 was backported > after commit f775b13eedee. > > [1] https://www.spinics.net/lists/stable/msg263931.html > > Fixes: 4124a4cff344 ("x86,kvm: move qemu/guest FPU switching out to vcpu_run") > Cc: stable@vger.kernel.org > Cc: Sasha Levin > Cc: Greg Kroah-Hartman > Cc: Peter Xu > Cc: Rik van Riel > Cc: Paolo Bonzini > Cc: Radim Krčmář > Reported-by: Roman Mamedov > Reported-by: Thomas Lindroth > Signed-off-by: Sean Christopherson > --- > arch/x86/kvm/x86.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) Thanks so much for this, sorry for the mis-merge, nice catch! Now queued up. greg k-h