From owner-svn-src-head@FreeBSD.ORG Sat Jun 9 17:39:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C712C1065670; Sat, 9 Jun 2012 17:39:05 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2F798FC17; Sat, 9 Jun 2012 17:39:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q59Hd5lU045582; Sat, 9 Jun 2012 17:39:05 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59Hd5UX045580; Sat, 9 Jun 2012 17:39:05 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201206091739.q59Hd5UX045580@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 9 Jun 2012 17:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236819 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 17:39:05 -0000 Author: melifaro Date: Sat Jun 9 17:39:05 2012 New Revision: 236819 URL: http://svn.freebsd.org/changeset/base/236819 Log: 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: kib(mentor) MFC after: 3 days Modified: head/sys/netinet/ipfw/ip_fw_table.c Modified: head/sys/netinet/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_table.c Sat Jun 9 16:44:35 2012 (r236818) +++ head/sys/netinet/ipfw/ip_fw_table.c Sat Jun 9 17:39:05 2012 (r236819) @@ -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 */