Commit dd073d97 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Luis Henriques

x86, fpu: __restore_xstate_sig()->math_state_restore() needs preempt_disable()

commit df24fb85 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: default avatarOleg Nesterov <oleg@redhat.com>
Link: http://lkml.kernel.org/r/20140902175717.GA21649@redhat.comReviewed-by: default avatarSuresh Siddha <sbsiddha@gmail.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 62c3b5a2
...@@ -399,8 +399,11 @@ int __restore_xstate_sig(void __user *buf, void __user *buf_fx, int size) ...@@ -399,8 +399,11 @@ int __restore_xstate_sig(void __user *buf, void __user *buf_fx, int size)
set_used_math(); set_used_math();
} }
if (use_eager_fpu()) if (use_eager_fpu()) {
preempt_disable();
math_state_restore(); math_state_restore();
preempt_enable();
}
return err; return err;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment