[Bug 272319] FreeBSD kernel crash on MPD5 restart with PPP configuration.

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 02 Jul 2023 11:59:29 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272319

--- Comment #8 from Aleksandr Fedorov <afedorov@FreeBSD.org> ---
I think fix should look like this:

diff --git a/sys/netgraph/ng_ksocket.c b/sys/netgraph/ng_ksocket.c
index ba9845410e42..7074549ae403 100644
--- a/sys/netgraph/ng_ksocket.c
+++ b/sys/netgraph/ng_ksocket.c
@@ -936,12 +936,18 @@ ng_ksocket_shutdown(node_p node)

        /* Close our socket (if any) */
        if (priv->so != NULL) {
-               SOCKBUF_LOCK(&priv->so->so_rcv);
-               soupcall_clear(priv->so, SO_RCV);
-               SOCKBUF_UNLOCK(&priv->so->so_rcv);
-               SOCKBUF_LOCK(&priv->so->so_snd);
-               soupcall_clear(priv->so, SO_SND);
-               SOCKBUF_UNLOCK(&priv->so->so_snd);
+               /*
+                * SOLISTENNIG sockets doesn't have data upcalls.
+                */
+               if (!SOLISTENING(priv->so)) {
+                       SOCKBUF_LOCK(&priv->so->so_rcv);
+                       soupcall_clear(priv->so, SO_RCV);
+                       SOCKBUF_UNLOCK(&priv->so->so_rcv);
+                       SOCKBUF_LOCK(&priv->so->so_snd);
+                       soupcall_clear(priv->so, SO_SND);
+                       SOCKBUF_UNLOCK(&priv->so->so_snd);
+               }
+
                soclose(priv->so);
                priv->so = NULL;
        }

-- 
You are receiving this mail because:
You are the assignee for the bug.