From owner-svn-src-all@FreeBSD.ORG Mon Feb 4 14:57:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9257F1CC; Mon, 4 Feb 2013 14:57:06 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-ie0-x234.google.com (mail-ie0-x234.google.com [IPv6:2607:f8b0:4001:c03::234]) by mx1.freebsd.org (Postfix) with ESMTP id 3EA7CA2; Mon, 4 Feb 2013 14:57:06 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id bn7so4739771ieb.39 for ; Mon, 04 Feb 2013 06:57:06 -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=QxWNfz9uf5GGvels76STA0WNZDu6g42RXNt9k4ghKCA=; b=YbPaF6baH9qFTbKU5c0gxjFZ+IAAiE5+AFoBXKThVKDMpnW8nC5iU+ujQYyr2xmP8x ORVIGcmatdNUAT7HbLBQEK7x0gK6BbJDxXmK1xWfse9Wt9o2OuFXvIIqpQcMb9jlKjHP wgS5uS5ZVlha841yk2EfKKdjy19M3NhNaXr88lu4Y/3wyUHr6Ru9ZxMfj022uwAbESeT NYArUPlIS4KlXeHgMB0GhT2zEZULiB8Lz58PEgYRo5Nz9YZObVlrQSqUVoDAw2dEwp/X pG18unsphiC0nD/P+5lngBi6ojmXokN3LMBZnazWtSyyi9QPcKaONfyej1fm41BtbgN/ erZA== X-Received: by 10.50.135.100 with SMTP id pr4mr2307363igb.37.1359989825933; Mon, 04 Feb 2013 06:57:05 -0800 (PST) Received: from oddish.sandvine.com ([64.7.137.182]) by mx.google.com with ESMTPS id uj6sm16645048igb.4.2013.02.04.06.57.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 06:57:04 -0800 (PST) Sender: Mark Johnston Date: Mon, 4 Feb 2013 07:56:52 -0500 From: Mark Johnston To: Andriy Gapon Subject: Re: svn commit: r246245 - head/sys/netgraph Message-ID: <20130204125652.GA1543@oddish.sandvine.com> References: <201302021154.r12Bs0tp030831@svn.freebsd.org> <20130204003701.GA1700@oddish> <510F662C.1080007@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <510F662C.1080007@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Mark Johnston , 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 14:57:06 -0000 On Mon, Feb 04, 2013 at 09:41:32AM +0200, Andriy Gapon wrote: > on 04/02/2013 02:37 Mark Johnston said the following: > > 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. > > Mark, > > thank you for the report and sorry for the breakage. > Could you please try the following patch (slightly different from your patch)? Thanks, I can confirm that this one works too. > > diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c > index 6266f40..05ea402 100644 > --- a/sys/netgraph/ng_ether.c > +++ b/sys/netgraph/ng_ether.c > @@ -410,11 +410,16 @@ static void > ng_ether_ifnet_arrival_event(void *arg __unused, struct ifnet *ifp) > { > char name[IFNAMSIZ]; > - node_p node = IFP2NG(ifp); > + node_p node; > + > + /* Only ethernet interfaces are of interest. */ > + if (ifp->if_type != IFT_ETHER) > + return; > > /* > * Just return if it's a new interface without an ng_ether companion. > */ > + node = IFP2NG(ifp); > if (node == NULL) > return; > >