[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <453F421A.6070507@in.ibm.com>
Date: Wed, 25 Oct 2006 16:23:14 +0530
From: supriya kannery <supriyak@...ibm.com>
To: linux-kernel@...r.kernel.org
Subject: Incorrect order of last two arguments of ptrace for requests PPC_PTRACE_GETREGS,
SETREGS, GETFPREGS, SETFPREGS
In ptrace, when request is PPC_PTRACE_GETREGS, SETREGS, GETFPREGS and
SETFPREGS, order of the last two arguments is not correct.
General format of ptrace is ptrace (request, pid, addr, data). For the
above mentioned request ids in ppc64, if we use ptrace like
long reg[32];
ptrace (PPC_PTRACE_GETREGS, pid, 0, ®[0]);
the return value is always -1.
If we exchange the last two arguments like,
ptrace (PPC_PTRACE_GETREGS, pid, ®[0], 0);
it works!
This is because PPC_PTRACE_GETREGS option for powerpc is implemented
such that general purpose
registers of the child process get copied to the address variable
instead of data variable. Same is
the case with other PPC request options PPC_PTRACE_SETREGS, GETFPREGS
and SETFPREGS.
Prepared a patch for this problem and tested with 2.6.18-rc6 kernel.
This patch can be applied directly to
2.6.19-rc3 kernel.
View attachment "ppc_ptrace_params.patch" of type "text/plain" (3449 bytes)
Powered by blists - more mailing lists