Date: Mon, 20 Jan 1997 18:00:02 -0800 (PST) From: davidn@unique.usn.blaze.net.au (David Nugent) To: freebsd-bugs Subject: Re: kern/2535: filesize-cur resource limit reset to "infinity" Message-ID: <199701210200.SAA19691@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/2535; it has been noted by GNATS.
From: davidn@unique.usn.blaze.net.au (David Nugent)
To: bde@zeta.org.au (Bruce Evans)
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: kern/2535: filesize-cur resource limit reset to "infinity"
Date: Tue, 21 Jan 1997 12:54:14 +1100
Bruce Evans writes:
> >+ /* p->p_rlimit[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY; */
>
> rlimits are copy on write (implemented in software; grep for p_limit
> in kern_fork.c and kern_resource.c). The above code neglects to
> duplicate the struct before writing to it.
Suddenly things make sense - thanks Bruce. :-)
Is this patch the correct fix?
--- kern_exit.c.orig Wed Jan 15 14:55:26 1997
+++ kern_exit.c Tue Jan 21 12:48:57 1997
@@ -222,6 +222,10 @@
sp->s_leader = NULL;
}
fixjobc(p, p->p_pgrp, 0);
+ if (p->p_limit->p_refcnt > 1 && p->p_limit->p_lflags & PL_SHAREMOD) {
+ p->p_limit->p_refcnt--;
+ p->p_limit = limcopy(p->p_limit);
+ }
p->p_rlimit[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
(void)acct_process(p);
#ifdef KTRACE
Regards,
David Nugent - Unique Computing Pty Ltd - Melbourne, Australia
Voice +61-3-9791-9547 Data/BBS +61-3-9792-3507 3:632/348@fidonet
davidn@freebsd.org davidn@blaze.net.au http://www.blaze.net.au/~davidn/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701210200.SAA19691>
