Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jun 2012 14:15:14 +0000 (UTC)
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r237309 - stable/8/sys/netinet/ipfw
Message-ID:  <201206201415.q5KEFEan046872@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206201415.q5KEFEan046872>