svn commit: r237309 - stable/8/sys/netinet/ipfw

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


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

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/8/sys/netinet/ipfw/ip_fw_table.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/netinet/ipfw/ip_fw_table.c
==============================================================================
--- stable/8/sys/netinet/ipfw/ip_fw_table.c	Wed Jun 20 14:14:27 2012	(r237308)
+++ stable/8/sys/netinet/ipfw/ip_fw_table.c	Wed Jun 20 14:15:14 2012	(r237309)
@@ -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-all mailing list