Skip to contentSkip to conversation

Patch "x86/fpu: Fix get_xsave_addr() behavior under virtualization" has been added to the 4.3-stable tree

PATCH [email protected] 1 participant 1 message Dec 7, 2015

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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 <[email protected]> know about it.

Quoted 1 line

From a05917b6ba9dc9a95fc42bdcbe3a875e8ad83935 Mon Sep 17 00:00:00 2001

From: Huaitong Han <[email protected]>
Date: Fri, 6 Nov 2015 17:00:23 +0800
Subject: x86/fpu: Fix get_xsave_addr() behavior under virtualization

From: Huaitong Han <[email protected]>

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.

Cc Andy Lutomirski <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Fenghua Yu <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Oleg Nesterov <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Quentin Casasnovas <[email protected]>
Cc Thomas Gleixner <[email protected]>
[ Tidied up the changelog. ]
---
 arch/x86/kernel/fpu/xstate.c |    1 -
 1 file changed, 1 deletion(-)
arch/x86/kernel/fpu/xstate.c +0 -1
@@ -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 [email protected] are

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