Source-Changes-HG archive

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

[src/netbsd-1-6]: src/sys/sys Pull up revision 1.142 (requested by jdolocek i...



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

description:
Pull up revision 1.142 (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/sys/proc.h |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r 8afd141585ce -r 1b0a9592d1d8 sys/sys/proc.h
--- a/sys/sys/proc.h    Mon Jul 29 15:37:48 2002 +0000
+++ b/sys/sys/proc.h    Mon Jul 29 15:37:58 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.137 2002/04/02 20:20:00 jdolecek Exp $      */
+/*     $NetBSD: proc.h,v 1.137.4.1 2002/07/29 15:37:58 lukem Exp $     */
 
 /*-
  * Copyright (c) 1986, 1989, 1991, 1993
@@ -176,9 +176,9 @@
 /*
  * The following fields are all zeroed upon creation in fork.
  */
-#define        p_startzero     p_oppid
+#define        p_startzero     p_opptr
 
-       pid_t           p_oppid;        /* Save parent pid during ptrace. XXX */
+       struct proc     *p_opptr;       /* Save parent during ptrace. */
        int             p_dupfd;        /* Sideways return value from filedescopen. XXX */
 
        /* Scheduling */
@@ -296,7 +296,7 @@
 #define        P_32            0x040000 /* 32-bit process (used on 64-bit kernels) */
 #define        P_BIGLOCK       0x080000 /* Process needs kernel "big lock" to run */
 #define        P_INEXEC        0x100000 /* Process is exec'ing and cannot be traced */
-
+#define        P_CHTRACED      0x400000 /* Child has been traced & reparented */
 
 /*
  * Macro to compute the exit signal to be delivered.



Home | Main Index | Thread Index | Old Index