From owner-freebsd-arch Fri Apr 6 18:53: 6 2001 Delivered-To: freebsd-arch@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id C61A637B424 for ; Fri, 6 Apr 2001 18:53:03 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (robert@fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.11.3/8.11.3) with SMTP id f371rWf16452; Fri, 6 Apr 2001 21:53:33 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Fri, 6 Apr 2001 21:53:32 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Matt Dillon Cc: Terry Lambert , freebsd-arch@FreeBSD.ORG Subject: Re: Eliminate crget() from nfs kernel code? In-Reply-To: <200104062249.f36Mnr448378@earth.backplane.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 Fri, 6 Apr 2001, Matt Dillon wrote: > nfs_statfs() is not cached. You should be able to use the > process ucred unmodified, though no testing has been done > so we can't be absolutely sure it will work with a wide > variety of NFS server platforms until we try it. It's worth > finding out, though. I'd like to see this bit of code cleaned > up. Ok, I've committed a change to 5.0-CURRENT to move to simply using the p->p_ucred rather than constructing a ucred using crget(). I've interop'd with Solaris and FreeBSD NFS servers, and it seemed to work fine. I'd appreciate it if others could do testing -- the primary test is simply whether "df /your/nfs/mount" running as non-root DTRT. I haven't had a chance yet, but sometime in the next day or two I'll get out and RPC dumper (dunno if tcpdump knows how to do this, maybe snoop from Solaris does) and look at the credentials used for NFSPROC_STATFS requests generated by other implementations. Chances are, if another already uses normal non-uid-0 non-gid-0 credentials, then we're safe. There's similar code in the ncp implementation, but I haven't followed up on that yet. Moving over to using p->p_ucred did fix my panics with an expanded ucred, so the current fix remedies the panic I was running into during my development. Dunno if Boris is reading this, but if so, perhaps he can look at a similar change in netncp. Thanks, Robert N M Watson FreeBSD Core Team, TrustedBSD Project robert@fledge.watson.org NAI Labs, Safeport Network Services To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message