tree 8a594fd4be652d14e3795d046eeda2dc33103c33
parent 961f8bc9fc91c39a3fe169f3b6d3df1b096769d3
author David S. Miller <[EMAIL PROTECTED]> Mon, 18 Apr 2005 08:03:11 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Mon, 18 Apr 2005 08:03:11 -0700

[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.

Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 sparc/kernel/ptrace.c   |   12 ------------
 sparc64/kernel/ptrace.c |   19 -------------------
 2 files changed, 31 deletions(-)

Index: arch/sparc/kernel/ptrace.c
===================================================================
--- 2d7af71ae798fda8be5e1979fe61bfca3f2d3b20/arch/sparc/kernel/ptrace.c  
(mode:100644 sha1:fc4ad69357b8793a08af10692112c405d6affa04)
+++ 8a594fd4be652d14e3795d046eeda2dc33103c33/arch/sparc/kernel/ptrace.c  
(mode:100644 sha1:c4f93bd2daf27b61f527fe0b2a1da5642e389e94)
@@ -530,18 +530,6 @@
                        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);
Index: arch/sparc64/kernel/ptrace.c
===================================================================
--- 2d7af71ae798fda8be5e1979fe61bfca3f2d3b20/arch/sparc64/kernel/ptrace.c  
(mode:100644 sha1:1722dc51b0d8f5c1732eabaae7637d7b1adc2d76)
+++ 8a594fd4be652d14e3795d046eeda2dc33103c33/arch/sparc64/kernel/ptrace.c  
(mode:100644 sha1:08bac537262acb9b2ee0ef395996fac482dc8226)
@@ -514,25 +514,6 @@
                        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);
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to