From owner-freebsd-current@FreeBSD.ORG Sun Mar 28 01:25:28 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 678A116A4CF for ; Sun, 28 Mar 2004 01:25:28 -0800 (PST) Received: from darkness.comp.waw.pl (unknown [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id A09AA43D3F for ; Sun, 28 Mar 2004 01:25:27 -0800 (PST) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id 50876ACAE3; Sun, 28 Mar 2004 11:25:26 +0200 (CEST) Date: Sun, 28 Mar 2004 11:25:26 +0200 From: Pawel Jakub Dawidek To: freebsd-current@freebsd.org Message-ID: <20040328092526.GX8930@darkness.comp.waw.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W0fIhK6DANimrc4b" Content-Disposition: inline User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 Subject: [jmc@netbsd.org: CVS commit: [netbsd-1-6] src/sys/kern] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2004 09:25:28 -0000 --W0fIhK6DANimrc4b Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi. I think this fix is also related to us, isn't it? ----- Forwarded message from James Chacon ----- X-Original-To: nick@garage.freebsd.pl Delivered-To: pjd@darkness.comp.waw.pl Delivered-To: source-changes@netbsd.org From: James Chacon Subject: CVS commit: [netbsd-1-6] src/sys/kern To: source-changes@NetBSD.org Reply-To: jmc@netbsd.org Date: Sun, 28 Mar 2004 08:02:36 +0000 (UTC) Precedence: list Commiter: James Chacon Branch: netbsd-1-6 Files: 1.93.6.3 src/sys/kern/kern_exit.c =20 Log Message: Pullup rev 1.104-1.106 (requested by junyoung in ticket #1615) Make sure that, if orphaned child is being traced, it's reparented back to the original parent before it's killed. Diffs: COMMAND: cvs -d:pserver:anoncvs@anoncvs.netbsd.org:/cvsroot rdiff -u -r1.93= .6.2 -r1.93.6.3 src/sys/kern/kern_exit.c Index: src/sys/kern/kern_exit.c diff -u src/sys/kern/kern_exit.c:1.93.6.2 src/sys/kern/kern_exit.c:1.93.6.3 --- src/sys/kern/kern_exit.c:1.93.6.2 Wed Oct 22 06:15:50 2003 +++ src/sys/kern/kern_exit.c Sun Mar 28 08:02:36 2004 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_exit.c,v 1.93.6.2 2003/10/22 06:15:50 jmc Exp $ */ +/* $NetBSD: kern_exit.c,v 1.93.6.3 2004/03/28 08:02:36 jmc Exp $ */ =20 /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -78,7 +78,7 @@ */ =20 #include -__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.93.6.2 2003/10/22 06:15:50 jmc= Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.93.6.3 2004/03/28 08:02:36 jmc= Exp $"); =20 #include "opt_ktrace.h" #include "opt_sysv.h" @@ -240,14 +240,25 @@ wakeup((caddr_t)initproc); for (; q !=3D 0; q =3D nq) { nq =3D q->p_sibling.le_next; - proc_reparent(q, initproc); + /* - * Traced processes are killed - * since their existence means someone is screwing up. + * Traced processes are killed since their existence + * means someone is screwing up. Since we reset the + * trace flags, the logic in sys_wait4() would not be + * triggered to reparent the process to its + * original parent, so we must do this here. */ if (q->p_flag & P_TRACED) { + if (q->p_opptr !=3D q->p_pptr) { + struct proc *t =3D q->p_opptr; + proc_reparent(q, t ? t : initproc); + q->p_opptr =3D NULL; + } else + proc_reparent(q, initproc); q->p_flag &=3D ~(P_TRACED|P_WAITED|P_FSTRACE); psignal(q, SIGKILL); + } else { + proc_reparent(q, initproc); } } =20 ----- End forwarded message ----- --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --W0fIhK6DANimrc4b Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAZpoGForvXbEpPzQRAsJ5AJ90FCc2hY9mRDwmee1HhLiLA5sk1ACeMxzI 3xtXc7GTqaGRaELBlsrn0ro= =Uhh7 -----END PGP SIGNATURE----- --W0fIhK6DANimrc4b--