[patch] x86, i387: use convert_to_fxsr() in fpregs_set()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Siddha, Suresh B
Date: Thursday, January 24, 2008 - 6:40 pm

Roland, Just happen to notice this bug. Can you please ack the bug fix which
needs to goto x86 mm tree.

thanks.
---
[patch] x86, i387: use convert_to_fxsr() in fpregs_set()

This fixes the bug introduced recently during the revamp of the code.
fpregs_set() need to use convert_to_fxsr() rather than copying into the
fxsave struct directly.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---

diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index 7e354a3..93a1706 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -327,6 +327,7 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
 	       const void *kbuf, const void __user *ubuf)
 {
 	int ret;
+	struct user_i387_ia32_struct env;
 
 	if (!HAVE_HWFP)
 		return fpregs_soft_set(target, regset, pos, count, kbuf, ubuf);
@@ -339,13 +340,9 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
 					  &target->thread.i387.fsave, 0, -1);
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
-				 &target->thread.i387.fxsave, 0, -1);
-
-	/*
-	 * mxcsr reserved bits must be masked to zero for security reasons.
-	 */
-	target->thread.i387.fxsave.mxcsr &= mxcsr_feature_mask;
+				 &env, 0, -1);
 
+	convert_to_fxsr(target, &env);
 	return ret;
 }
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch] x86, i387: use convert_to_fxsr() in fpregs_set(), Siddha, Suresh B, (Thu Jan 24, 6:40 pm)
[PATCH x86/mm] x86: i387 fpregs_set convert_to_fxsr, Roland McGrath, (Thu Jan 24, 6:59 pm)
Re: [PATCH x86/mm] x86: i387 fpregs_set convert_to_fxsr, Siddha, Suresh B, (Fri Jan 25, 11:04 am)
Re: [PATCH x86/mm] x86: i387 fpregs_set convert_to_fxsr, Roland McGrath, (Fri Jan 25, 1:38 pm)