summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/ptrace_32.c
diff options
context:
space:
mode:
authorPhil Edworthy <Phil.Edworthy@renesas.com>2011-03-18 15:16:31 +0100
committerPaul Mundt <lethal@linux-sh.org>2011-03-23 14:17:52 +0100
commitc49b6ecf0870e78fa40497cd8b142915c1d5c7c9 (patch)
tree17a0bb980bbf9ce734f62068016e69d4f46175ac /arch/sh/kernel/ptrace_32.c
parentsh: Re-enable GENERIC_HARDIRQS_NO_DEPRECATED. (diff)
downloadlinux-c49b6ecf0870e78fa40497cd8b142915c1d5c7c9.tar.xz
linux-c49b6ecf0870e78fa40497cd8b142915c1d5c7c9.zip
sh: Fix ptrace fpu state initialisation
Commit 0ea820cf introduced the PTRACE_GETFPREGS/SETFPREGS cmds, but gdb-server still accesses the FPU state using the PTRACE_PEEKUSR/POKEUSR commands. In this case, xstate was not initialised. Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com> Cc: stable@kernel.org Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/ptrace_32.c')
-rw-r--r--arch/sh/kernel/ptrace_32.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c
index 90a15d29feeb..b53664ef53e8 100644
--- a/arch/sh/kernel/ptrace_32.c
+++ b/arch/sh/kernel/ptrace_32.c
@@ -392,6 +392,9 @@ long arch_ptrace(struct task_struct *child, long request,
tmp = 0;
} else {
unsigned long index;
+ ret = init_fpu(child);
+ if (ret)
+ break;
index = addr - offsetof(struct user, fpu);
tmp = ((unsigned long *)child->thread.xstate)
[index >> 2];
@@ -423,6 +426,9 @@ long arch_ptrace(struct task_struct *child, long request,
else if (addr >= offsetof(struct user, fpu) &&
addr < offsetof(struct user, u_fpvalid)) {
unsigned long index;
+ ret = init_fpu(child);
+ if (ret)
+ break;
index = addr - offsetof(struct user, fpu);
set_stopped_child_used_math(child);
((unsigned long *)child->thread.xstate)