lkml.org 
[lkml]   [2003]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Lazy FPU handling in ptrace

While working on some x86-64 ptrace problems I noticed that i386
has bugs in this area too.

Before doing PTRACE_SETFPREGS or PTRACE_SETFPXREGS you need to do
an unlazy_fpu(), otherwise there is no guarantee that the changed
state will be picked up.

Patch for 2.4, but 2.5 seems to have it too.

(untested, but obviously correct ;-)
-Andi

--- linux-work/arch/i386/kernel/ptrace.c-o 2002-08-08 10:27:42.000000000 +0200
+++ linux-work/arch/i386/kernel/ptrace.c 2003-03-14 21:51:21.000000000 +0100
@@ -381,6 +381,7 @@
ret = -EIO;
break;
}
+ unlazy_fpu(child);
child->used_math = 1;
set_fpregs(child, (struct user_i387_struct *)data);
ret = 0;
@@ -405,6 +406,7 @@
ret = -EIO;
break;
}
+ unlazy_fpu(child);
child->used_math = 1;
ret = set_fpxregs(child, (struct user_fxsr_struct *)data);
break;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.085 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site