From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 4 20:49:54 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C45016A415; Thu, 4 Jan 2007 20:49:54 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (palm.hoeg.nl [83.98.131.212]) by mx1.freebsd.org (Postfix) with ESMTP id C961713C43E; Thu, 4 Jan 2007 20:49:53 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id EBB7B1CC5D; Thu, 4 Jan 2007 21:49:52 +0100 (CET) Date: Thu, 4 Jan 2007 21:49:52 +0100 From: Ed Schouten To: bug-followup@FreeBSD.org, philippe.lang@attiksystem.ch Message-ID: <20070104204952.GT1072@hoeg.nl> References: <20070104201434.GS1072@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aE2Tjr+Wh4rS13mJ" Content-Disposition: inline In-Reply-To: <20070104201434.GS1072@hoeg.nl> User-Agent: Mutt/1.5.13 (2006-08-11) X-Mailman-Approved-At: Thu, 04 Jan 2007 21:11:02 +0000 Cc: FreeBSD Hackers Subject: Re: kern/89528: [jail] impossible to kill a jail X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jan 2007 20:49:54 -0000 --aE2Tjr+Wh4rS13mJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ed Schouten wrote: > As long as pty's have been allocated that have been created by threads > in a jail, the prison structure has more references, causing the zombie > jails to exist. We could change the make_dev_credv() routine to crcopy() everything except the prison when we're creating a node in a jail. The following patch fixes the zombie jail bug on my machine: --- src/sys/kern/kern_conf.c Fri Oct 20 09:59:50 2006 +++ src/sys/kern/kern_conf.c Thu Jan 4 21:36:44 2007 @@ -42,6 +42,7 @@ #include #include #include +#include #include =20 #include @@ -563,7 +564,15 @@ =09 dev->si_flags |=3D SI_NAMED; if (cr !=3D NULL) - dev->si_cred =3D crhold(cr); + if (cr->cr_prison =3D=3D NULL) { + dev->si_cred =3D crhold(cr); + } else { + /* Don't let the node depend on a prison */ + dev->si_cred =3D crget(); + crcopy(dev->si_cred, cr); + prison_free(dev->si_cred->cr_prison); + dev->si_cred->cr_prison =3D NULL; + } else dev->si_cred =3D NULL; dev->si_uid =3D uid; Could other people experiencing this problem as well give this patch a try? Thanks a lot! Yours, --=20 Ed Schouten WWW: http://g-rave.nl/ --aE2Tjr+Wh4rS13mJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFFnWhw52SDGA2eCwURAnf9AJ47ZpkxiM8s2KznHU+NncdjiqjHpACcCzJQ jfxOzPnh9zjiOAxisCY8e5A= =TOCY -----END PGP SIGNATURE----- --aE2Tjr+Wh4rS13mJ--