Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/sys/compat/svr4 Pull up revision 1.98 (requested by jdo...



details:   https://anonhg.NetBSD.org/src/rev/69b23ead68c0
branches:  netbsd-1-6
changeset: 528637:69b23ead68c0
user:      lukem <lukem%NetBSD.org@localhost>
date:      Mon Jul 29 15:37:12 2002 +0000

description:
Pull up revision 1.98 (requested by jdolocek in ticket #557):
Make sure that the pointer to old parent process for ptraced children
gets reset properly when the old parent exits before the child. A flag
is set in old parent process when the child is reparented in ptrace(2).
If it's set when process is exiting, all running processes have their
'old parent process' pointer checked and reset if appropriate. Also
change to use 'struct proc *' pointer directly, rather than pid_t.
This fixes security/14444 by David Sainty.
Reviewed by Christos Zoulas.

diffstat:

 sys/compat/svr4/svr4_misc.c |  11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diffs (33 lines):

diff -r b49f07e81549 -r 69b23ead68c0 sys/compat/svr4/svr4_misc.c
--- a/sys/compat/svr4/svr4_misc.c       Mon Jul 29 15:29:12 2002 +0000
+++ b/sys/compat/svr4/svr4_misc.c       Mon Jul 29 15:37:12 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_misc.c,v 1.97 2002/03/31 22:22:49 christos Exp $   */
+/*     $NetBSD: svr4_misc.c,v 1.97.4.1 2002/07/29 15:37:12 lukem Exp $  */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_misc.c,v 1.97 2002/03/31 22:22:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_misc.c,v 1.97.4.1 2002/07/29 15:37:12 lukem Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1240,11 +1240,10 @@
                         * parent a SIGCHLD.  The rest of the cleanup will be
                         * done when the old parent waits on the child.
                         */
-                       if ((q->p_flag & P_TRACED) &&
-                           q->p_oppid != q->p_pptr->p_pid) {
-                               t = pfind(q->p_oppid);
+                       if ((q->p_flag & P_TRACED) && q->p_opptr != q->p_pptr){
+                               t = q->p_opptr;
                                proc_reparent(q, t ? t : initproc);
-                               q->p_oppid = 0;
+                               q->p_opptr = NULL;
                                q->p_flag &= ~(P_TRACED|P_WAITED|P_FSTRACE);
                                psignal(q->p_pptr, SIGCHLD);
                                wakeup((caddr_t)q->p_pptr);



Home | Main Index | Thread Index | Old Index