Kernel panic in nfsv4_loadattr

Rick Macklem rmacklem at uoguelph.ca
Sun Jun 25 22:44:08 UTC 2017


Fabian Freyer wrote:
> I've had a panic on a host mounting NFSv4 shares. There are also jails
> running on this host acessing these shares (I assume this might be a
> problem, as I'm also seeing the nfsuserd messages mentioned in [1]).
> Here's the last relevant lines of the kernel message buffer.

> Jun 25 05:47:39 emmi nfsuserd:[916]: req from ip=0x[REDACTED] port=949
> kernel trap 12 with interrupts disabled
The nfsuserd daemon doesn't work when jails are enabled. (I'm not a jails
person, but I understand jails blocks/disables 127.0.0.1 and that will definitely
break nfsuserd.)

I have a patch that switches nfsuserd to use a local socket to avoid this, but
another tester experienced hangs when using it. I believe the hangs were
caused by races in the local socket code tickled by having multiple nfsuserd
daemons running, but since I could not reproduce the hang, I never committed
the patch to head, etc.
(There is PR#205193 for this.)

Without the patch, you have three choices:
1 - Set vfs.nfsd.enable_stringtouid=1 and don't run the nfsuserd. (This should allow
      NFSv4 to work, assuming you are not doing Kerberos mounts and your uid space
      is consistent between clients and server.)
2 - Get rid of the jails.
3 - Change all your mounts to NFSv3 and don't try to run the nfsuserd daemon.

In case you can test the patch, I have attached it. (It is actually 2 patches, one for
nfsuserd.c and one for the kernel. I don't remember what version of sources it
is done for, but since you didn't mention what version of FreeBSD you are running...)
If you test it, make sure to include "1" as the last argument to nfsuserd, so that it
only runs one daemon.

- Until someone successfully tests this patch, this problem will probably remain, rick
[stuff snipped]
ps: If you can test it, but have trouble applying the patch, email and I'll try to update
      the patch to current sources.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nfsuserd-aflocal.patch
Type: application/octet-stream
Size: 4683 bytes
Desc: nfsuserd-aflocal.patch
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20170625/13b4a5d6/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nfsuserd-aflocal-kern.patch
Type: application/octet-stream
Size: 4120 bytes
Desc: nfsuserd-aflocal-kern.patch
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20170625/13b4a5d6/attachment-0001.obj>


More information about the freebsd-hackers mailing list