Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Apr 2001 18:24:23 -0700
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Terry Lambert <tlambert@primenet.com>, Matt Dillon <dillon@earth.backplane.com>, arch@FreeBSD.ORG
Subject:   Re: Found BAD BUG: squashed
Message-ID:  <20010418182423.A976@fw.wintelcom.net>
In-Reply-To: <Pine.BSF.4.21.0104191046120.5481-100000@besplex.bde.org>; from bde@zeta.org.au on Thu, Apr 19, 2001 at 11:19:08AM %2B1000
References:  <200104182323.QAA22635@usr07.primenet.com> <Pine.BSF.4.21.0104191046120.5481-100000@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* Bruce Evans <bde@zeta.org.au> [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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010418182423.A976>