rpc.lockd brokenness (2)

Kris Kennaway kris at obsecurity.org
Mon Mar 13 20:33:01 UTC 2006

On Mon, Mar 13, 2006 at 05:15:59PM +0000, Miguel Lopes Santos Ramos wrote:

> > I'm not yet sure whether this is a regression in 6.x or another case
> > that was broken forever.
> I didn't have problems in 5. I just compiled a 6.0-RELEASE kernel, and it
> is also broken.

I have verified (using loopback mounts and a fcntl() regression test)
that the same locking bug exists in 5.4's rpc.lockd with nfsv2, so if
you're not seeing it there then perhaps you're just lucky :(

> > Unfortunately there's currently no option to use NFSv3 for nfs root
> > mounts to work around this (unless you're using bootp), but it should
> > just be a trivial matter of adding "| NFSMNT_NFSV3" to the flags in
> > nfsclient/nfs_diskless.c:nfs_setup_diskless():
> >
> > 	nd->root_args.flags = (NFSMNT_WSIZE | NFSMNT_RSIZE | NFSMNT_RESVPORT);
> It was only today that I could try your sugestion. But... I get a kernel panic,
> it can't find init...
> Looking is nfsclient/bootp_subr.c, it looks like there's a little more to do
> when mounting via NFSv3.

Yes, I see the same thing.  Sorry.  It would be nice to have a way to
do nfsv3 root mounts, so perhaps I'll work on this some more.

> Well, this doesn't work, but thanks to your sugestion, by looking in
> nfs_diskless.c, I found a loader option to disable lockd,
> boot.nfsroot.options=lockd. This option is new (it doesn't exist on 6.0).
> Now I can lock any file not only on /var, but also on /etc, etc. (remember
> this option in fstab wasn't honored for the root mount)
> Everything works. Locking in shared home directories also work, because they're
> NFSv3 mounts (I tried it already...).
> So, I finally have it working, and all I needed was having this in loader.conf:
> boot.nfsroot.options=lockd.
> I'm quite tired of this issue, so, for all I'm concerned, I'm done.

Yes, this is probably the best possible workaround.  Unfortunately,
rpc.lockd has no maintainer, so the many bugs and deficiencies in it
will probably stay unresolved for the forseeable future.

> Is the NFSv2/rpc.lockd issue reported?

Not yet, I'll file a PR when I get the time.

> Is there any information more that I can provide?

I don't think so, thanks for your help.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20060313/404cfda3/attachment.pgp

More information about the freebsd-stable mailing list