public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
* [PATCH] powerpc: Fix reading/writing FPRs on 32 bit apps with ptrace on 64 bit kernels
@ 2009-03-24  6:04 Michael Neuling
  0 siblings, 0 replies; only message in thread
From: Michael Neuling @ 2009-03-24  6:04 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev, stable

Fix the calculation for offsetting into the FPRs when ptracing a 32 bit
app on 64 bit kernels.

Signed-off-by: Michael Neuling <mikey@neuling•org>
cc: stable@kernel•org
---
benh: it'd be nice if this went back in to 27,28 & 29

Also, I vote we kill ptracing 64 bit apps from 32 apps as it's
completely broken and no one has ever noticed.

 arch/powerpc/kernel/ptrace32.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6-ozlabs/arch/powerpc/kernel/ptrace32.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/ptrace32.c
+++ linux-2.6-ozlabs/arch/powerpc/kernel/ptrace32.c
@@ -67,7 +67,7 @@ static long compat_ptrace_old(struct tas
 /* Macros to workout the correct index for the FPR in the thread struct */
 #define FPRNUMBER(i) (((i) - PT_FPR0) >> 1)
 #define FPRHALF(i) (((i) - PT_FPR0) & 1)
-#define FPRINDEX(i) TS_FPRWIDTH * FPRNUMBER(i) + FPRHALF(i)
+#define FPRINDEX(i) TS_FPRWIDTH * FPRNUMBER(i) * 2 + FPRHALF(i)
 
 long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
 			compat_ulong_t caddr, compat_ulong_t cdata)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-24  6:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-24  6:04 [PATCH] powerpc: Fix reading/writing FPRs on 32 bit apps with ptrace on 64 bit kernels Michael Neuling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox