stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "x86/fpu: Fix get_xsave_addr() behavior under virtualization" has been added to the 4.3-stable tree
@ 2015-12-07  8:31 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-12-07  8:31 UTC (permalink / raw)
  To: huaitong.han, bp, dave.hansen, fenghua.yu, gregkh, hpa, luto,
	mingo, oleg, pbonzini, peterz, quentin.casasnovas, tglx, torvalds
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    x86/fpu: Fix get_xsave_addr() behavior under virtualization

to the 4.3-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     x86-fpu-fix-get_xsave_addr-behavior-under-virtualization.patch
and it can be found in the queue-4.3 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From a05917b6ba9dc9a95fc42bdcbe3a875e8ad83935 Mon Sep 17 00:00:00 2001
From: Huaitong Han <huaitong.han@intel.com>
Date: Fri, 6 Nov 2015 17:00:23 +0800
Subject: x86/fpu: Fix get_xsave_addr() behavior under virtualization

From: Huaitong Han <huaitong.han@intel.com>

commit a05917b6ba9dc9a95fc42bdcbe3a875e8ad83935 upstream.

KVM uses the get_xsave_addr() function in a different fashion from
the native kernel, in that the 'xsave' parameter belongs to guest vcpu,
not the currently running task.

But 'xsave' is replaced with current task's (host) xsave structure, so
get_xsave_addr() will incorrectly return the bad xsave address to KVM.

Fix it so that the passed in 'xsave' address is used - as intended
originally.

Signed-off-by: Huaitong Han <huaitong.han@intel.com>
Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: dave.hansen@intel.com
Link: http://lkml.kernel.org/r/1446800423-21622-1-git-send-email-huaitong.han@intel.com
[ Tidied up the changelog. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/kernel/fpu/xstate.c |    1 -
 1 file changed, 1 deletion(-)

--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -402,7 +402,6 @@ void *get_xsave_addr(struct xregs_state
 	if (!boot_cpu_has(X86_FEATURE_XSAVE))
 		return NULL;
 
-	xsave = &current->thread.fpu.state.xsave;
 	/*
 	 * We should not ever be requesting features that we
 	 * have not enabled.  Remember that pcntxt_mask is


Patches currently in stable-queue which might be from huaitong.han@intel.com are

queue-4.3/x86-fpu-fix-get_xsave_addr-behavior-under-virtualization.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-07 12:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-07  8:31 Patch "x86/fpu: Fix get_xsave_addr() behavior under virtualization" has been added to the 4.3-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).