summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2014-09-02 19:57:17 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-14 08:47:54 -0800
commitb888e3d442069e3107d9b4a43c1321e4d555b6cd (patch)
treebfbba55a4bc78ff064e34efb811b4825d8d7e7d1 /arch/x86
parent6507b92a66c9551b0555edc5a92e27027c3b990e (diff)
downloadlinux-3.10-b888e3d442069e3107d9b4a43c1321e4d555b6cd.tar.gz
linux-3.10-b888e3d442069e3107d9b4a43c1321e4d555b6cd.tar.bz2
linux-3.10-b888e3d442069e3107d9b4a43c1321e4d555b6cd.zip
x86, fpu: __restore_xstate_sig()->math_state_restore() needs preempt_disable()
commit df24fb859a4e200d9324e2974229fbb7adf00aef upstream. Add preempt_disable() + preempt_enable() around math_state_restore() in __restore_xstate_sig(). Otherwise __switch_to() after __thread_fpu_begin() can overwrite fpu->state we are going to restore. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Link: http://lkml.kernel.org/r/20140902175717.GA21649@redhat.com Reviewed-by: Suresh Siddha <sbsiddha@gmail.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/xsave.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index ada87a329ed..92a099fabd5 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -400,8 +400,11 @@ int __restore_xstate_sig(void __user *buf, void __user *buf_fx, int size)
set_used_math();
}
- if (use_eager_fpu())
+ if (use_eager_fpu()) {
+ preempt_disable();
math_state_restore();
+ preempt_enable();
+ }
return err;
} else {