⬢ DragonFlyBSD Kernel Audit
DF-4432 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/netif/sln/if_sln.c
+++ b/sys/dev/netif/sln/if_sln.c
@@ -946,7 +946,11 @@
 		PDEBUG("ipackets = %lu\n", ipkts);
 #endif
 
-		ifp->if_input(ifp, m, NULL, -1);
+		/* DF-4432: m_devget() may have failed above; never feed a
+		 * NULL mbuf to if_input().  Do not `continue' here - the
+		 * rx_offset advance below is what moves the walk on. */
+		if (m != NULL)
+			ifp->if_input(ifp, m, NULL, -1);
 
 		rx_offset = (rx_offset + rx_size + 4) & (u_long) (SL_RX_BUFLEN - 1);	/* 4 bytes for receive
 											 * frame head */