svn commit: r352311 - head/sys/netpfil/ipfw

Gleb Smirnoff glebius at FreeBSD.org
Fri Sep 13 22:36:05 UTC 2019


Author: glebius
Date: Fri Sep 13 22:36:04 2019
New Revision: 352311
URL: https://svnweb.freebsd.org/changeset/base/352311

Log:
  Drivers may pass runt packets to filter. This is okay.
  
  Reviewed by:	gallatin

Modified:
  head/sys/netpfil/ipfw/ip_fw2.c

Modified: head/sys/netpfil/ipfw/ip_fw2.c
==============================================================================
--- head/sys/netpfil/ipfw/ip_fw2.c	Fri Sep 13 21:28:08 2019	(r352310)
+++ head/sys/netpfil/ipfw/ip_fw2.c	Fri Sep 13 22:36:04 2019	(r352311)
@@ -1448,7 +1448,10 @@ ipfw_chk(struct ip_fw_args *args)
 do {								\
 	int x = (_len) + T + EHLEN;				\
 	if (mem) {						\
-		MPASS(pktlen >= x);				\
+		if (__predict_false(pktlen < x)) {		\
+			unlock;					\
+			goto pullup_failed;			\
+		}						\
 		p = (char *)args->mem + (_len) + EHLEN;		\
 	} else {						\
 		if (__predict_false((m)->m_len < x)) {		\


More information about the svn-src-all mailing list