From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 02:37:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 093B3CCE; Mon, 4 Feb 2013 02:37:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-ie0-x22d.google.com (mail-ie0-x22d.google.com [IPv6:2607:f8b0:4001:c03::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 8734C847; Mon, 4 Feb 2013 02:37:40 +0000 (UTC) Received: by mail-ie0-f173.google.com with SMTP id 9so5167144iec.4 for ; Sun, 03 Feb 2013 18:37:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=Hp81WM8D/DTTKap51RuDCh2U5lIE78tvSjyP13e4obY=; b=sTOj1K9I1KctMVz//xmPtzjnQ6jzhnpuhFw6S5RyhBVXmHSSARY6QFfZtCVAP+iz+f /dvurCq0wlYe43vQTVk0bf2fAaSF4XREq/EUBCZvyFXCFOK56aDeQ419zipHQBE8tCCT mpQJoqWpiUrTArgyasGxAJXpJd/i1QeIRDcoP+wELjnS2m6UColZSULi9HUGDKtpWkHK Y3+doZQCw2BDw8DF5FXcKZLzZfboSou8uvs8DgJ8/wyRYtD0J069nUz8tIr1HyltKW6w OcGDycx2u9Lf0P9ykijbcmMGWpY8wx4vLJgax+AGOhbHi9f1lntQuMjmKpaailw6w4se hviA== X-Received: by 10.50.202.3 with SMTP id ke3mr4038866igc.49.1359945459475; Sun, 03 Feb 2013 18:37:39 -0800 (PST) Received: from oddish ([66.11.160.25]) by mx.google.com with ESMTPS id u4sm13712600igw.6.2013.02.03.18.37.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 03 Feb 2013 18:37:38 -0800 (PST) Sender: Mark Johnston Date: Sun, 3 Feb 2013 19:37:30 -0500 From: Mark Johnston To: Andriy Gapon Subject: Re: svn commit: r246245 - head/sys/netgraph Message-ID: <20130204003701.GA1700@oddish> References: <201302021154.r12Bs0tp030831@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201302021154.r12Bs0tp030831@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 04 Feb 2013 02:37:41 -0000 On Sat, Feb 02, 2013 at 11:54:00AM +0000, Andriy Gapon wrote: > Author: avg > Date: Sat Feb 2 11:54:00 2013 > New Revision: 246245 > URL: http://svnweb.freebsd.org/changeset/base/246245 > > Log: > ng_ether: track interface renaming > > Also sanitize interface names that can potentially contain characters > that are prohibited in netgraph names. > > PR: kern/154850 (sanitizing of names) > Discussed with: eri, melifaro > Submitted by: Nikolay Denev (sanitizing code) > Reviewed by: eri, glebius > MFC after: 17 days > > Modified: > head/sys/netgraph/ng_ether.c > Hi Andriy, This commit seems to cause a panic during boot when creating the loopback interface. I couldn't get a core dump but the problem seems to happen when dereferencing ifp->if_l2com in the IFP2NG macro in ng_ether_ifnet_arrival_event(). In the case of lo(4) this pointer seems to be NULL (I suppose because lo(4) doesn't register itself in the if_com_alloc/free tables). The patch below fixes the panic for me. Thanks, -Mark diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c index 6266f40..f566346 100644 --- a/sys/netgraph/ng_ether.c +++ b/sys/netgraph/ng_ether.c @@ -410,7 +410,12 @@ static void ng_ether_ifnet_arrival_event(void *arg __unused, struct ifnet *ifp) { char name[IFNAMSIZ]; - node_p node = IFP2NG(ifp); + node_p node; + + if (ifp->if_l2com == NULL) + return; + + node = IFP2NG(ifp); /* * Just return if it's a new interface without an ng_ether companion.