Page MenuHomeFreeBSD

sockstat: Fix segfault when peer has no pid

Authored by on May 10 2024, 2:44 AM.
Referenced Files
Unknown Object (File)
Tue, May 21, 4:29 AM
Unknown Object (File)
Sat, May 18, 8:29 PM
Unknown Object (File)
Sat, May 18, 10:23 AM
Unknown Object (File)
Fri, May 17, 7:22 PM
Unknown Object (File)
Fri, May 17, 3:42 AM
Unknown Object (File)
May 12 2024, 7:23 PM



If a dgram socket's remote end is the kernel, there may not
be a file associated with it. I've seen this with gssd's kernel
rpc socket. Arguably the kernel should do something better, but
for now handle the possibility.

Signed-off-by: Dan McGregor <>

Diff Detail

rG FreeBSD src repository
Lint Passed
No Test Coverage
Build Status
Buildable 57649
Build 54537: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.May 10 2024, 6:12 PM

Thanks, @tuexen and @emaste. This does affect my NFS server on every version I've tried in the 14-STABLE or 15-CURRENT series. 13.3 is unaffected. Looks like everything since commit a83d596f434f in 2022.

I have no commit bit, so if somebody could commit this it'd be appreciated.