DragonFlyBSD Kernel Audit
DF-1478 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/dev/netif/my/if_my.c b/sys/dev/netif/my/if_my.c
--- a/sys/dev/netif/my/if_my.c
+++ b/sys/dev/netif/my/if_my.c
@@ -1105,6 +1105,11 @@
 		total_len = (rxstat & MY_FLNGMASK) >> MY_FLNGShift;
 		total_len -= ETHER_CRC_LEN;
 
+		if (total_len > MCLBYTES) {
+			IFNET_STAT_INC(ifp, ierrors, 1);
+			cur_rx->my_ptr->my_status = MY_OWNByNIC;
+			continue;
+		}
 		if (total_len < MINCLSIZE) {
 			m = m_devget(mtod(cur_rx->my_mbuf, void *),
 				     total_len, 0, ifp);