Re: ptrace broken in 2.3.99-pre1

From: Mike Coleman (mcoleman2@kc.rr.com)
Date: Tue May 16 2000 - 21:58:16 EST


mbarnum@inprise.com (Maurice S. Barnum) writes:
> 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.

I posted a patch for this a couple of days ago, and hopefully it will be
included in the very next 99-pre version. Here it is again.

And yes, the change is there for a reason. It allows better ptrace'ing
capabilities. SUBTERFUGUE (see subterfugue.org), for example, makes use of
this.

--Mike

--- kernel/fork.c.dist Tue May 2 00:29:14 2000
+++ kernel/fork.c Fri May 12 17:40:55 2000
@@ -674,7 +674,7 @@
 
         if ((clone_flags & CLONE_VFORK) || !(clone_flags & CLONE_PARENT)) {
                 p->p_opptr = current;
- if (!(current->flags & PF_PTRACED))
+ if (!(p->flags & PF_PTRACED))
                         p->p_pptr = current;
         }
         p->p_cptr = NULL;

-- 
Any sufficiently adverse technology is indistinguishable from Microsoft.

- 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