From: Andi Kleen <ak@muc.de>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] Lazy FPU handling in ptrace
Date: Fri, 14 Mar 2003 21:56:33 +0100 [thread overview]
Message-ID: <20030314205633.GA7373@averell> (raw)
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;
next reply other threads:[~2003-03-14 20:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-14 20:56 Andi Kleen [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-03-14 21:11 [PATCH] Lazy FPU handling in ptrace Manfred Spraul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030314205633.GA7373@averell \
--to=ak@muc.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.