From owner-freebsd-arch Sun Sep 3 7:26:35 2000 Delivered-To: freebsd-arch@freebsd.org Received: from localhost (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id BFC4837B43E; Sun, 3 Sep 2000 07:26:32 -0700 (PDT) Date: Sun, 3 Sep 2000 10:26:31 -0400 (EDT) From: Brian Fundakowski Feldman X-Sender: green@green.dyndns.org To: Don Lewis Cc: arch@freebsd.org Subject: Re: width of cr_ref In-Reply-To: <200009031204.FAA19222@salsa.gv.tsc.tdk.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 3 Sep 2000, Don Lewis wrote: > Now that sockets hold a reference to the ucred structure, should cr_ref > be a wider type? Really busy servers with a lot of sockets owned by one > user might overflow cr_ref, causing mysterious crashes when the ucred > structure is freed too early. > > struct ucred { > u_short cr_ref; /* reference count */ > uid_t cr_uid; /* effective user id */ > short cr_ngroups; /* number of groups */ > gid_t cr_groups[NGROUPS]; /* groups */ > }; And since it's a big structure anyway... and the u_short either unaligns or pads the next int-sized field (cr_uid)... I have no objections to making ucred have a u_int cr_ref. -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / green@FreeBSD.org `------------------------------' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message