diff options
author | Oleg Nesterov <oleg@redhat.com> | 2014-09-02 19:57:17 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-14 08:59:47 -0800 |
commit | eb3975c8907cc9cab47c3759faf653101c8aec95 (patch) | |
tree | ee9c2711bb2dd49d7caec07dbe5b2a3457252d94 /arch/x86/kernel | |
parent | c8d171f62647794b4e7ab59b4fdd62e6b0e4cd42 (diff) | |
download | kernel-common-eb3975c8907cc9cab47c3759faf653101c8aec95.tar.gz kernel-common-eb3975c8907cc9cab47c3759faf653101c8aec95.tar.bz2 kernel-common-eb3975c8907cc9cab47c3759faf653101c8aec95.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/kernel')
-rw-r--r-- | arch/x86/kernel/xsave.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c index a4b451c6addf..4679ef4005da 100644 --- a/arch/x86/kernel/xsave.c +++ b/arch/x86/kernel/xsave.c @@ -399,8 +399,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 { |