public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* ptrace compat issue
@ 2006-04-05  3:16 David S. Miller
  0 siblings, 0 replies; only message in thread
From: David S. Miller @ 2006-04-05  3:16 UTC (permalink / raw)
  To: linux-arch


Others may run into this too, so I'm mentioning this.

PTRACE_GETEVENTMSG writes a long into the user address space, this has
to be made an int for compat tasks.  If you get this wrong a lot of
debugging things will break, as GDB currently makes extensive use of
this facility these days.

It might be nice to try and consolidate this into a single location,
but I frankly think that's overkill and doing it in the per-arch
ptrace() syscall handler is just the easiest thing to do right now.

diff-tree acdb28098a91c930909c257da1c0837b875a11fb (from c5959ae91b2e6e93000c58d428f91c5b5b46868d)
Author: David S. Miller <davem@sunset.davemloft.net>
Date:   Tue Apr 4 16:54:40 2006 -0700

    [SPARC64]: Translate PTRACE_GETEVENTMSG for 32-bit tasks.
    
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c
index c910af5..49e6ded 100644
--- a/arch/sparc64/kernel/ptrace.c
+++ b/arch/sparc64/kernel/ptrace.c
@@ -609,6 +609,22 @@ #endif
 
 	/* PTRACE_DUMPCORE unsupported... */
 
+	case PTRACE_GETEVENTMSG: {
+		int err;
+
+		if (test_thread_flag(TIF_32BIT))
+			err = put_user(child->ptrace_message,
+				       (unsigned int __user *) data);
+		else
+			err = put_user(child->ptrace_message,
+				       (unsigned long __user *) data);
+		if (err)
+			pt_error_return(regs, -err);
+		else
+			pt_succ_return(regs, 0);
+		break;
+	}
+
 	default: {
 		int err = ptrace_request(child, request, addr, data);
 		if (err)

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

only message in thread, other threads:[~2006-04-05  3:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-05  3:16 ptrace compat issue David S. Miller

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