From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 19:36:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4EF41065672; Mon, 28 Sep 2009 19:36:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7E1E88FC17; Mon, 28 Sep 2009 19:36:53 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 2F4DC46B03; Mon, 28 Sep 2009 15:36:53 -0400 (EDT) Date: Mon, 28 Sep 2009 20:36:53 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Baldwin In-Reply-To: <200909281511.25338.jhb@freebsd.org> Message-ID: References: <200909281855.n8SItTDF062998@svn.freebsd.org> <200909281511.25338.jhb@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jamie Gritton Subject: Re: svn commit: r197584 - head/sys/rpc/rpcsec_gss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2009 19:36:53 -0000 On Mon, 28 Sep 2009, John Baldwin wrote: > ============================================================================== >> --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Sep 28 18:54:26 2009 > (r197583) >> +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Sep 28 18:55:29 2009 > (r197584) >> @@ -449,6 +449,8 @@ rpc_gss_svc_getcred(struct svc_req *req, >> cr->cr_uid = cr->cr_ruid = cr->cr_svuid = uc->uid; >> cr->cr_rgid = cr->cr_svgid = uc->gid; >> crsetgroups(cr, uc->gidlen, uc->gidlist); >> + cr->cr_prison = &prison0; >> + prison_hold(cr->cr_prison); >> *crp = crhold(cr); >> >> return (TRUE); > > FYI, it would be nice if prison_hold() returned a pointer to the prison as > you can then do what crhold() does above: > > cr->cr_prison = prison_hold(&prison0); > > I prefer combining the refcount and assignment into one step with the goal > of avoiding outright assignments that don't go via foo_hold() or fooref() > for refcounted objects. In the long-term, explicit references to proc0, prison0, thread0, filedesc0, ... all make me rather nervous. I'd rather that all these things were linked to either the credentials of the file system mount, the user thread, or perhaps gssd in some cases. From the perspective if virtualization, the file system mount credential seems the most likely candidate. Robert