Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jun 2012 14:13:08 +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-9@freebsd.org
Subject:   svn commit: r237307 - stable/9/sys/netinet/ipfw
Message-ID:  <201206201413.q5KED8hj046680@svn.freebsd.org>

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



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