Re: panic excl->shared for an AF_LOCAL socket

2018-08-21 Thread Rick Macklem
Matthew Macy wrote:
[stuff snipped]
>I don't know what's special in this case, but I did revamp the locking there 
>several >months back so I'll take a look next weekend.

Thanks but don't worry about it for now. I think I figured out how the panic()
occurred. If the nfsd was accessing /var/run/nfsuserd.sock for a client and then
tried to soconnect() to it to do the upcall, the nfsd thread would already have
/var/run/nfsuserd.sock vnode locked.

The old way (and what FreeBSD-11 still does) was to use a UDP socket, which
isn't in the file system namespace. (I switched the default to AF_LOCAL so that
nfsuserd could be used in jails where 127.0.0.1 doesn't work, but I now think
it isn't safe to use an AF_LOCAL socket, since it is in the file system's 
namespace
and, therefore, can be accessed directly by the NFS code.

I think I'll revert the "switch to AF_LOCAL socket" patch.

Hopefully the reporter can help confirm this "theory", rick


___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: panic excl->shared for an AF_LOCAL socket

2018-08-19 Thread Matthew Macy
On Sun, Aug 19, 2018 at 4:32 PM Rick Macklem  wrote:

> Hi,
>
> PR#230752 shows a witness panic() for "excl->shared" on a vnode lock.
> In this case, the kernel RPC code is trying to do a soconnect() on an
> AF_LOCAL
> socket. The code is unp_connectat() looks like is does a straightforward
> namei()/lookup(), so I am surprised to see this.
>
> Does anyone know if AF_LOCAL (unix domain) sockets are somehow handled
> differently for namei()/lookup() which might cause this?
>
> I've requested more info from the reporter w.r.t. when this happens.
> (I'd guess when the nfsuserd is terminating or has terminated or ???)
>
> Thanks for any help with this, rick
>

I don't know what's special in this case, but I did revamp the locking
there several months back so I'll take a look next weekend.
-M
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"