[Bug 275920] Kernel crash in sys/netlink/route/iface.c:124

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 25 Dec 2023 09:44:27 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275920

Kristof Provost <kp@freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jhibbits@FreeBSD.org,
                   |                            |kp@freebsd.org,
                   |                            |loos@FreeBSD.org,
                   |                            |mizhka@FreeBSD.org

--- Comment #2 from Kristof Provost <kp@freebsd.org> ---
That's interesting. The cause is fairly obvious. e6000sw creates struct ifnets
that don't have an ioctl handler, and that's triggering this crash.

The following is probably the best fix, assuming that the ioctl-less e6000sw
ifnet is intentional:

diff --git a/sys/net/if.c b/sys/net/if.c
index 9f44223af0dd..c3c27fbf678f 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -4871,6 +4871,9 @@ if_resolvemulti(if_t ifp, struct sockaddr **srcs, struct
sockaddr *dst)
 int
 if_ioctl(if_t ifp, u_long cmd, void *data)
 {
+       if (ifp->if_ioctl == NULL)
+               return (EOPNOTSUPP);
+
        return (ifp->if_ioctl(ifp, cmd, data));
 }

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