| Summary: | sockstat(1) and lsof(8) can not identity the owner of listening UDP ports when it is the kernel | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Ben Woods <woodsb02> |
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Open --- | ||
| Severity: | Affects Some People | CC: | cem, nowak |
| Priority: | --- | Keywords: | needs-patch |
| Version: | CURRENT | Flags: | koobs:
mfc-stable12?
koobs: mfc-stable11? |
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Ben Woods
2016-09-12 14:33:33 UTC
I believe this is because udp nfs socket is opened by a kernel thread so there is no user/pid/command/fd to report. (In reply to nowak from comment #1) So the TCP socket is opened by userspace, but the UDP socket is opened by the kernel? It seems the UDP socket is opened by userspace too: https://github.com/freebsd/freebsd/blob/master/usr.sbin/nfsd/nfsd.c#L463-L491 However, we pass the UDP socket into the kernel with nfssvc_addsock and close the userspace copy. We keep the TCP one open in order to do accept(2). Hi Conrad, Thanks for that description - it makes sense. It's still surprising from a user's point of view to see ? in the output of sockstat. Can you think of any way this could be improved? Could sockstat report it is being used by the kernel, or even better nfs within the kernel? I can confirm this bug on 11.0, but only for the UDP port: # sockstat -4l | grep 2049 root nfsd 646 5 tcp4 *:2049 *:* ? ? ? ? udp4 *:2049 *:* This issue has also been raised on the freebsd-hackers mailing list: https://lists.freebsd.org/pipermail/freebsd-hackers/2019-February/054146.html |