Date: Thu, 4 Jan 2007 14:34:16 -0700 From: "Coleman Kane" <zombyfork@gmail.com> To: "Ed Schouten" <ed@fxq.nl> Cc: FreeBSD Hackers <freebsd-hackers@freebsd.org>, philippe.lang@attiksystem.ch, bug-followup@freebsd.org Subject: Re: kern/89528: [jail] impossible to kill a jail Message-ID: <346a80220701041334x484380a6n4d8d7a575d8fc659@mail.gmail.com> In-Reply-To: <20070104204952.GT1072@hoeg.nl> References: <20070104201434.GS1072@hoeg.nl> <20070104204952.GT1072@hoeg.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
On 1/4/07, Ed Schouten <ed@fxq.nl> wrote: > > * Ed Schouten <ed@fxq.nl> 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 <sys/ctype.h> > #include <sys/tty.h> > #include <sys/ucred.h> > +#include <sys/jail.h> > #include <machine/stdarg.h> > > #include <fs/devfs/devfs_int.h> > @@ -563,7 +564,15 @@ > > dev->si_flags |= SI_NAMED; > if (cr != NULL) > - dev->si_cred = crhold(cr); > + if (cr->cr_prison == NULL) { > + dev->si_cred = crhold(cr); > + } else { > + /* Don't let the node depend on a prison */ > + dev->si_cred = crget(); > + crcopy(dev->si_cred, cr); > + prison_free(dev->si_cred->cr_prison); > + dev->si_cred->cr_prison = NULL; > + } > else > dev->si_cred = NULL; > dev->si_uid = uid; > > Could other people experiencing this problem as well give this patch a > try? Thanks a lot! > > Yours, > -- > Ed Schouten <ed@fxq.nl> > WWW: http://g-rave.nl/ > > > Does this behavior still occur if you set sysctl kern.pts.enable=1 ? Is this at all related to why I have been experiencing zombies left behind for any process that alloc's its own tty (such as gnome-terminal [actually gnome-pty-helper])? If I CTRL-D to end a gnome-terminal session, it will hang all of the gnome-terminals I have open and I typically have to reboot to clear out the zombies that remain. I can't open any more apps that use gnome-pty-helper to allocate ttys unless I attempt to kill it and start it anew (and I am not even completely sure if that works). -- Coleman Kane
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?346a80220701041334x484380a6n4d8d7a575d8fc659>