summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/fpu
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-05-25 08:57:06 (GMT)
committerIngo Molnar <mingo@kernel.org>2015-05-27 12:11:27 (GMT)
commitce2a1e67f1738535b011a7b4bd42cc114b1d805f (patch)
treedfb7d99bc746b40a2e656038b30503c1ea589cfe /arch/x86/kernel/fpu
parent343763c3b0a4fa2d29f7c3ba405abf8771b90876 (diff)
downloadlinux-ce2a1e67f1738535b011a7b4bd42cc114b1d805f.tar.xz
x86/fpu: Add debugging check to fpu__restore()
The copy_fpstate_to_fpregs() function is never supposed to fail, so add a debugging check to its call site in fpu__restore(). Cc: Andy Lutomirski <luto@amacapital.net> Cc: Bobby Powers <bobbypowers@gmail.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Dave Hansen <dave.hansen@linux.intel.com> 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: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/fpu')
-rw-r--r--arch/x86/kernel/fpu/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
index 86a9a9a..874ef17 100644
--- a/arch/x86/kernel/fpu/core.c
+++ b/arch/x86/kernel/fpu/core.c
@@ -371,6 +371,8 @@ void fpu__restore(struct fpu *fpu)
kernel_fpu_disable();
fpregs_activate(fpu);
if (unlikely(copy_fpstate_to_fpregs(fpu))) {
+ /* Copying the kernel state to FPU registers should never fail: */
+ WARN_ON_FPU(1);
fpu__clear(fpu);
force_sig_info(SIGSEGV, SEND_SIG_PRIV, current);
} else {