This is a note to let you know that I've just added the patch titled
sh: Fix ptrace fpu state initialisation
to the 2.6.37-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
sh-fix-ptrace-fpu-state-initialisation.patch
and it can be found in the queue-2.6.37 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From c49b6ecf0870e78fa40497cd8b142915c1d5c7c9 Mon Sep 17 00:00:00 2001
From: Phil Edworthy <[email protected]>
Date: Fri, 18 Mar 2011 14:16:31 +0000
Subject: sh: Fix ptrace fpu state initialisation
From: Phil Edworthy <[email protected]>
commit c49b6ecf0870e78fa40497cd8b142915c1d5c7c9 upstream.
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 <[email protected]>
Signed-off-by: Paul Mundt <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
arch/sh/kernel/ptrace_32.c | 6 ++++++
arch/sh/kernel/ptrace_64.c | 6 ++++++
2 files changed, 12 insertions(+)
--- a/arch/sh/kernel/ptrace_32.c
+++ b/arch/sh/kernel/ptrace_32.c
@@ -392,6 +392,9 @@ long arch_ptrace(struct task_struct *chi
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 *chi
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)
--- a/arch/sh/kernel/ptrace_64.c
+++ b/arch/sh/kernel/ptrace_64.c
@@ -403,6 +403,9 @@ long arch_ptrace(struct task_struct *chi
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);
tmp = get_fpu_long(child, index);
} else if (addr == offsetof(struct user, u_fpvalid)) {
@@ -442,6 +445,9 @@ long arch_ptrace(struct task_struct *chi
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);
ret = put_fpu_long(child, index, data);
}
Patches currently in stable-queue which might be from [email protected]
are
queue-2.6.37/sh-fix-ptrace-fpu-state-initialisation.patch
_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable