Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Apr 2001 21:53:32 -0400 (EDT)
From:      Robert Watson <rwatson@FreeBSD.ORG>
To:        Matt Dillon <dillon@earth.backplane.com>
Cc:        Terry Lambert <tlambert@primenet.com>, freebsd-arch@FreeBSD.ORG
Subject:   Re: Eliminate crget() from nfs kernel code?
Message-ID:  <Pine.NEB.3.96L.1010406214910.13782E-100000@fledge.watson.org>
In-Reply-To: <200104062249.f36Mnr448378@earth.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1010406214910.13782E-100000>