From owner-svn-src-all@FreeBSD.ORG Thu Feb 10 01:24:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CCB41065670; Thu, 10 Feb 2011 01:24:09 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AA218FC12; Thu, 10 Feb 2011 01:24:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1A1O98G004480; Thu, 10 Feb 2011 01:24:09 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1A1O9VY004478; Thu, 10 Feb 2011 01:24:09 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <201102100124.p1A1O9VY004478@svn.freebsd.org> From: Max Laier Date: Thu, 10 Feb 2011 01:24:09 +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: r218503 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Feb 2011 01:24:09 -0000 Author: mlaier Date: Thu Feb 10 01:24:09 2011 New Revision: 218503 URL: http://svn.freebsd.org/changeset/base/218503 Log: As info.rti_info[RTAX_DST] can point inside of rtm we must not free the rtm until rt_dispatch is done with the sockaddr. Found by: memguard MFC after: 3 days Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Thu Feb 10 00:20:56 2011 (r218502) +++ head/sys/net/rtsock.c Thu Feb 10 01:24:09 2011 (r218503) @@ -883,7 +883,6 @@ flush: m = NULL; } else if (m->m_pkthdr.len > rtm->rtm_msglen) m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len); - Free(rtm); } if (m) { if (rp) { @@ -898,6 +897,9 @@ flush: } else rt_dispatch(m, info.rti_info[RTAX_DST]); } + /* info.rti_info[RTAX_DST] (used above) can point inside of rtm */ + if (rtm) + Free(rtm); } return (error); #undef sa_equal