svn commit: r237307 - stable/9/sys/netinet/ipfw

Alexander V. Chernikov melifaro at FreeBSD.org
Wed Jun 20 14:13:08 UTC 2012


Author: melifaro
Date: Wed Jun 20 14:13:07 2012
New Revision: 237307
URL: http://svn.freebsd.org/changeset/base/237307

Log:
  MFC r236819
  
  Validate IPv4 network mask being passed to ipfw kernel interface.
  Incorrect mask can possibly be one of the reasons for kern/127209 existance.
  
  Approved by:        ae(mentor)

Modified:
  stable/9/sys/netinet/ipfw/ip_fw_table.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netinet/ipfw/ip_fw_table.c
==============================================================================
--- stable/9/sys/netinet/ipfw/ip_fw_table.c	Wed Jun 20 14:11:18 2012	(r237306)
+++ stable/9/sys/netinet/ipfw/ip_fw_table.c	Wed Jun 20 14:13:07 2012	(r237307)
@@ -153,6 +153,9 @@ ipfw_add_table_entry(struct ip_fw_chain 
 	case IPFW_TABLE_CIDR:
 		if (plen == sizeof(in_addr_t)) {
 #ifdef INET
+			/* IPv4 case */
+			if (mlen > 32)
+				return (EINVAL);
 			ent = malloc(sizeof(*ent), M_IPFW_TBL, M_WAITOK | M_ZERO);
 			ent->value = value;
 			/* Set 'total' structure length */


More information about the svn-src-stable-9 mailing list