DragonFlyBSD Kernel Audit
DF-1490 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/dev/netif/tx/if_tx.c b/sys/dev/netif/tx/if_tx.c
--- a/sys/dev/netif/tx/if_tx.c
+++ b/sys/dev/netif/tx/if_tx.c
@@ -580,6 +580,11 @@
 
 		/* Save packet length and mbuf contained packet */
 		len = desc->rxlength - ETHER_CRC_LEN;
+		if (len > MCLBYTES) {
+			IFNET_STAT_INC(ifp, ierrors, 1);
+			desc->status = 0x8000;
+			continue;
+		}
 		m = buf->mbuf;
 
 		/* Try to get mbuf cluster */