From owner-freebsd-arch Wed Apr 18 18:24:29 2001 Delivered-To: freebsd-arch@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id A981837B42C for ; Wed, 18 Apr 2001 18:24:26 -0700 (PDT) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f3J1ONA14496; Wed, 18 Apr 2001 18:24:23 -0700 (PDT) Date: Wed, 18 Apr 2001 18:24:23 -0700 From: Alfred Perlstein To: Bruce Evans Cc: Terry Lambert , Matt Dillon , arch@FreeBSD.ORG Subject: Re: Found BAD BUG: squashed Message-ID: <20010418182423.A976@fw.wintelcom.net> References: <200104182323.QAA22635@usr07.primenet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from bde@zeta.org.au on Thu, Apr 19, 2001 at 11:19:08AM +1000 X-all-your-base: are belong to us. Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Bruce Evans [010418 18:21] wrote: > On Wed, 18 Apr 2001, Terry Lambert wrote: > > > > :The cr_ref is an unsigned short, and ... > > This was fixed in -current in: > > RCS file: /home/ncvs/src/sys/sys/ucred.h,v > Working file: ucred.h > head: 1.22 > ... > ---------------------------- > revision 1.18 > date: 2000/11/27 00:09:16; author: alfred; state: Exp; lines: +11 -3 > ucred system overhaul: > ... > 4) expand the size of the refcount from a u_short to an u_int, by using > shorts we might have an overflow. > > Glanced at by: jake > ---------------------------- > > > > > > > Ahhh.. Excellent find Terry! > > > > > > Why do you want to cycle a new credential when the unsigned short > > > ref count reaches 65535 (what you call the right fix) verses simply > > > changing the ref count to an unsigned long (what you call the quick > > > and dirty fix)? That seems kinda reversed to me. > > > Because my use is not the common use, and it bloats the cred > > structure to a non-4-byte boundary, which I thought might end > > up being problematic for some people. > > Bloatage of struct ucred occurred in 4.4BSD when uid_t's and gid_t's > were changed from 16 bits to 32 bits. "u_short cr_ref" is followed > by "uid_t cr_uid", so there are normally 2 bytes wasted after "cr_ref". > These bytes can used for larger reference counts without changing the > size of the struct, but not without breaking binary compatibility. > Fortunately, "cr_ref" is invalid in userland. *slaps forhead* Bruce, you rule. Any chance you can fix this before release? You should be right about refcounts. I know binary compatbility is important, however since it's contained within the kernel I think that supporting > 32k sockets per application might be a nice thing for 4.3. -- -Alfred Perlstein - [alfred@freebsd.org] Daemon News Magazine in your snail-mail! http://magazine.daemonnews.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message