ptrace broken in 2.3.99-pre1

From: Maurice S. Barnum (mbarnum@inprise.com)
Date: Tue May 16 2000 - 20:43:09 EST


the first change below in fork.c prevents traced processes from being able to
properly trace their children, making it somewhat difficult to debug a
debugger. one of the simpler ways to demonstrate the problem:

        strace /usr/bin/strace /bin/true

i haven't studied the source in any detail yet, so i don't have a
patch to offer --- reversing the change "works" for me, but i'm
assuming the change was made for a reason.

--- v2.3.51/linux/kernel/fork.c Fri Mar 10 16:40:50 2000
+++ linux/kernel/fork.c Mon Mar 13 16:33:10 2000
@@ -647,8 +647,11 @@
         p->run_list.next = NULL;
         p->run_list.prev = NULL;
 
- if ((clone_flags & CLONE_VFORK) || !(clone_flags & CLONE_PARENT))
- p->p_pptr = p->p_opptr = current;
+ if ((clone_flags & CLONE_VFORK) || !(clone_flags & CLONE_PARENT)) {
+ p->p_opptr = current;
+ if (!(current->flags & PF_PTRACED))
+ p->p_pptr = current;
+ }
         p->p_cptr = NULL;
         init_waitqueue_head(&p->wait_chldexit);
         p->vfork_sem = NULL;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue May 23 2000 - 21:00:12 EST