From owner-svn-src-stable@FreeBSD.ORG Sat Jun 9 22:44:50 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C817106564A; Sat, 9 Jun 2012 22:44:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 373AB8FC18; Sat, 9 Jun 2012 22:44:50 +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 q59Mio70058358; Sat, 9 Jun 2012 22:44:50 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q59Min8a058356; Sat, 9 Jun 2012 22:44:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201206092244.q59Min8a058356@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 9 Jun 2012 22:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236827 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 22:44:50 -0000 Author: bz Date: Sat Jun 9 22:44:49 2012 New Revision: 236827 URL: http://svn.freebsd.org/changeset/base/236827 Log: MFC r236615: Plug two interface address refcount leaks in early error return cases in the ioctl path. Reported by: rpaulo Reviewed by: emax Modified: stable/8/sys/netinet6/in6.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Sat Jun 9 22:44:24 2012 (r236826) +++ stable/8/sys/netinet6/in6.c Sat Jun 9 22:44:49 2012 (r236827) @@ -1556,14 +1556,19 @@ in6_lifaddr_ioctl(struct socket *so, u_l hostid = IFA_IN6(ifa); /* prefixlen must be <= 64. */ - if (64 < iflr->prefixlen) + if (64 < iflr->prefixlen) { + if (ifa != NULL) + ifa_free(ifa); return EINVAL; + } prefixlen = iflr->prefixlen; /* hostid part must be zero. */ sin6 = (struct sockaddr_in6 *)&iflr->addr; if (sin6->sin6_addr.s6_addr32[2] != 0 || sin6->sin6_addr.s6_addr32[3] != 0) { + if (ifa != NULL) + ifa_free(ifa); return EINVAL; } } else