summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavem@davemloft.net <davem@davemloft.net>2005-04-29 18:03:49 -0700
committerGreg KH <gregkh@suse.de>2005-05-12 10:00:22 -0700
commit12ca665cce7f63eac7064a7aabd71afe53b70be7 (patch)
tree66a4baaed5dc6122c3a0ff394d97bcedddedbe94
parent17440e80600fed1e7a4483935111434fd5e00079 (diff)
downloadlinux-stable-12ca665cce7f63eac7064a7aabd71afe53b70be7.tar.gz
linux-stable-12ca665cce7f63eac7064a7aabd71afe53b70be7.tar.bz2
linux-stable-12ca665cce7f63eac7064a7aabd71afe53b70be7.zip
[PATCH] sparc: Fix PTRACE_CONT bogosity
SunOS aparently had this weird PTRACE_CONT semantic which we copied. If the addr argument is something other than 1, it sets the process program counter to whatever that value is. This is different from every other Linux architecture, which don't do anything with the addr and data args. This difference in particular breaks the Linux native GDB support for fork and vfork tracing on sparc and sparc64. There is no interest in running SunOS binaries using this weird PTRACE_CONT behavior, so just delete it so we behave like other platforms do. From: "David S. Miller" <davem@davemloft.net> Signed-off-by: Chris Wright <chrisw@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--arch/sparc/kernel/ptrace.c12
-rw-r--r--arch/sparc64/kernel/ptrace.c19
2 files changed, 0 insertions, 31 deletions
diff --git a/arch/sparc/kernel/ptrace.c b/arch/sparc/kernel/ptrace.c
index 9cd81b47f0ee..08c549120c7b 100644
--- a/arch/sparc/kernel/ptrace.c
+++ b/arch/sparc/kernel/ptrace.c
@@ -531,18 +531,6 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
pt_error_return(regs, EIO);
goto out_tsk;
}
- if (addr != 1) {
- if (addr & 3) {
- pt_error_return(regs, EINVAL);
- goto out_tsk;
- }
-#ifdef DEBUG_PTRACE
- printk ("Original: %08lx %08lx\n", child->thread.kregs->pc, child->thread.kregs->npc);
- printk ("Continuing with %08lx %08lx\n", addr, addr+4);
-#endif
- child->thread.kregs->pc = addr;
- child->thread.kregs->npc = addr + 4;
- }
if (request == PTRACE_SYSCALL)
set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c
index 1722dc51b0d8..08bac537262a 100644
--- a/arch/sparc64/kernel/ptrace.c
+++ b/arch/sparc64/kernel/ptrace.c
@@ -514,25 +514,6 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
pt_error_return(regs, EIO);
goto out_tsk;
}
- if (addr != 1) {
- unsigned long pc_mask = ~0UL;
-
- if ((child->thread_info->flags & _TIF_32BIT) != 0)
- pc_mask = 0xffffffff;
-
- if (addr & 3) {
- pt_error_return(regs, EINVAL);
- goto out_tsk;
- }
-#ifdef DEBUG_PTRACE
- printk ("Original: %016lx %016lx\n",
- child->thread_info->kregs->tpc,
- child->thread_info->kregs->tnpc);
- printk ("Continuing with %016lx %016lx\n", addr, addr+4);
-#endif
- child->thread_info->kregs->tpc = (addr & pc_mask);
- child->thread_info->kregs->tnpc = ((addr + 4) & pc_mask);
- }
if (request == PTRACE_SYSCALL) {
set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);