In soclose() the second loop through lqueue should use TAILQ_FOREACH_SAFE since the socket is freed within the loop by soabort(), so the so_list pointer in that socket could be garbage.
A commit references this bug: Author: ae Date: Mon Aug 19 12:42:04 UTC 2019 New revision: 351214 URL: https://svnweb.freebsd.org/changeset/base/351214 Log: Use TAILQ_FOREACH_SAFE() macro to avoid use after free in soclose(). PR: 239893 MFC after: 1 week Changes: head/sys/kern/uipc_socket.c
^Triage: Assign to committer resolving
A commit references this bug: Author: ae Date: Mon Aug 26 09:29:15 UTC 2019 New revision: 351507 URL: https://svnweb.freebsd.org/changeset/base/351507 Log: MFC r351214: Use TAILQ_FOREACH_SAFE() macro to avoid use after free in soclose(). PR: 239893 Changes: _U stable/12/ stable/12/sys/kern/uipc_socket.c
Fixed in head/ and stable/12. Thanks!