From nobody@FreeBSD.org  Fri May 15 09:11:01 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1A5CD106567B
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 15 May 2009 09:11:01 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 0888D8FC1B
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 15 May 2009 09:11:01 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n4F9B0fN006732
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 15 May 2009 09:11:00 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n4F9B0MI006731;
	Fri, 15 May 2009 09:11:00 GMT
	(envelope-from nobody)
Message-Id: <200905150911.n4F9B0MI006731@www.freebsd.org>
Date: Fri, 15 May 2009 09:11:00 GMT
From: Sergei Cherveni <sergei.cherveni@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: 7.2 with mpd5.3 hanging up - ng_pptp problem
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         134557
>Category:       kern
>Synopsis:       [netgraph] [hang] 7.2 with mpd5.3 hanging up - ng_pptp problem
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-net
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 15 09:20:01 UTC 2009
>Closed-Date:    Sat Jul 04 06:02:03 UTC 2009
>Last-Modified:  Thu Aug 13 23:00:13 UTC 2009
>Originator:     Sergei Cherveni
>Release:        7.2-Stable
>Organization:
>Environment:
FreeBSD srv-gw1 7.2-STABLE FreeBSD 7.2-STABLE #0: Thu May 14 19:34:50 EEST 2009     root@srv-gw1:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
OS hangs out with a seconds after first pptp-client has connected to server. It's a gateway with net/mpd5.3 configured as pppoe-client and PPTP-server for VPN-clients.
If there is just pppoe-connection then the system does not hang.
Compiling custom kernel with NETGRAPH-options changes nothing.
Freebsd-7.2R has the same issue.
Freebsd-7.0R does not have the problem.

>How-To-Repeat:
Install net/mpd5.3, configure mpd.conf as pppoe-client and pptp-server.
Connect the server to network via pppoe. Connect pptp-client to server via pppoe-link. Send some traffic to server.

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri May 15 17:20:25 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=134557 

From: Sergei Cherveni <sergei.cherveni@gmail.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/134557: [netgraph] [hang] 7.2 with mpd5.3 hanging up -
 ng_pptp problem
Date: Tue, 19 May 2009 08:53:53 +0300

 FreeBSD 7.1-R does not hang with pptp-clients connected to server via
 pppoe link.

From: Alexander Motin <mav@FreeBSD.org>
To: bug-followup@FreeBSD.org, sergei.cherveni@gmail.com
Cc:  
Subject: Re: kern/134557: [netgraph] [hang] 7.2 with mpd5.3 hanging up - ng_pptp
 problem
Date: Tue, 19 May 2009 23:16:13 +0300

 Are you sure, that you haven't made routing or some other kind traffic 
 loop in kernel? There was added some protection against it recently, but 
 may be you have found some new way to do it? It was quite popular.
 
 -- 
 Alexander Motin

From: Motomichi Matsuzaki <mzaki@e-mail.ne.jp>
To: bug-followup@FreeBSD.org, mav@FreeBSD.org
Cc:  
Subject: Re: kern/134557: [netgraph] [hang] 7.2 with mpd5.3 hanging up - ng_pptp
 problem
Date: Sat, 06 Jun 2009 22:53:08 +0900

 Here is the same problem.
 I'm using mpd 4.4.1, which is configured to keep PPPoE connection to ISP.
 Mpd is also configured as a PPTP server, and it has worked fine on 7.1R;
 no problems both on normal PPPoE operation and incoming PPTP connection.
 However, upgrading to 7.2R (by freebsd-update) has changed the situation.
 
 -- 
 Motomichi Matsuzaki, PhD <mzaki@e-mail.ne.jp>

From: Bohdan Tymkiv <bohdan200@gmail.com>
To: bug-followup@FreeBSD.org, sergei.cherveni@gmail.com
Cc:  
Subject: Re: kern/134557: [netgraph] [hang] 7.2 with mpd5.3 hanging up -
 ng_pptp problem
Date: Sat, 06 Jun 2009 19:01:14 +0300

 I can confirm this issue. 
 I have a FreeBSD 7.2-STABLE box with mpd 5.3 configured as PPPoE client
 that connects to my ISP. If I make any PPTP VPN connection that goes
 through this PPPoE link my server hangs. I made some investigations and
 found that deadlock occurs only when pptp connection goes via pppoe
 link, connection from local network works fine. Deadlock occurs exactly
 when first data packet is sent through pptp connection. mpd can be
 configured as server that listens on my external pppoe interface or it
 can be configured as client that connects to other server in internet.
 In both cases it hangs.
 -- 
 Bohdan Tymkiv <bohdan200@gmail.com>
 

From: "Eugene M. Zheganin" <emz@norma.perm.ru>
To: bug-followup@FreeBSD.org, sergei.cherveni@gmail.com
Cc:  
Subject: Re: kern/134557: [netgraph] [hang] 7.2 with mpd3.5 hanging up - ng_pptp
 problem
Date: Mon, 08 Jun 2009 15:37:54 +0600

 Exactly same here.
 mpd 5.3 on 7.2-RELEASE, PPPoE client to WAN, PPTP over it.
 When mpd is configured as PPPoE-only client, all works just fine.
 When I add a pptp server fuctionality (config is proven to work on 
 previous versions), the system starts to hang after pptp session 
 connects and then disconnects.
 
 --
 Eugene M. Zheganin

From: Bohdan Tymkiv <bohdan200@gmail.com>
To: bug-followup@FreeBSD.org, sergei.cherveni@gmail.com
Cc:  
Subject: Re: kern/134557: [netgraph] [hang] 7.2 with mpd5.3 hanging up -
 ng_pptp problem
Date: Tue, 09 Jun 2009 19:12:28 +0300

 I confirm that downgrading to 7.1-RELEASE-p5 from svn sources on the
 same machine fixes the issue.
 -- 
 Bohdan Tymkiv <bohdan200@gmail.com>
 Home
 

From: Roar Pettersen <roar.pettersen@uib.no>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/134557: [netgraph] [hang] 7.2 with mpd5.3 hanging up -
 ng_pptp problem
Date: Wed, 10 Jun 2009 19:09:00 +0200 (CEST)

 Hi !
 
 
 We also see a similar problem with FreeBSD 7.2-Stable and MPD 5.3, after 
 4-5 days then the mpd process goes into a deadlock. Not able to kill
 the process or reload the server, have to press the Power Off button.
 
 System load is normaly 2-3%, but when the problem occur it raise to 
 30-35%. No error messages, nothing in the log files.
 
 The problem is releated to FreeBSD 7.2, no problem with 7.1.
 
 
 --
 
    Roar Pettersen
    Universitetet i Bergen -  The University of Bergen
    BERGEN  - Norway

From: Mikolaj Golub <to.my.trociny@gmail.com>
To: bug-followup@FreeBSD.org
Cc: freebsd-net@FreeBSD.org, Sergei Cherveni <sergei.cherveni@gmail.com>, Alexander Motin <mav@FreeBSD.org>
Subject: Re: kern/134557: [netgraph] [hang] 7.2 with mpd5.3 hanging up - ng_pptp problem
Date: Tue, 30 Jun 2009 22:33:12 +0300

 --=-=-=
 
 Unfortunately, the problem was introduced by this commit :-)
 
 ----------
 
 Author: 	mav
 Date: 	Sat Jan 31 12:48:09 2009 UTC (4 months, 4 weeks ago)
 Log Message: 	
 
 MFC rev. 187495
 
 Check for infinite recursion possible on some broken PPTP/L2TP/... VPN setups.
 Mark packets with mbuf_tag on first interface passage and drop on second.
 
 PR:		ports/129625, ports/125303
 
 ----------
 
 If a packet goes through two or more ng interfaces, "while" loop in the tag
 checking code can run infinitely. The attached patch should fix this.
 
 -- 
 Mikolaj Golub
 
 
 --=-=-=
 Content-Type: text/x-diff
 Content-Disposition: attachment; filename=ng_iface.c.patch
 
 --- netgraph/ng_iface.c.orig	2009-06-30 21:47:54.000000000 +0300
 +++ netgraph/ng_iface.c	2009-06-30 21:49:29.000000000 +0300
 @@ -365,7 +365,8 @@
  	}
  
  	/* Protect from deadly infinite recursion. */
 -	while ((mtag = m_tag_locate(m, MTAG_NGIF, MTAG_NGIF_CALLED, NULL))) {
 +	mtag = NULL;
 +	while ((mtag = m_tag_locate(m, MTAG_NGIF, MTAG_NGIF_CALLED, mtag))) {
  		if (*(struct ifnet **)(mtag + 1) == ifp) {
  			log(LOG_NOTICE, "Loop detected on %s\n", ifp->if_xname);
  			m_freem(m);
 
 --=-=-=--

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/134557: commit references a PR
Date: Wed,  1 Jul 2009 08:09:10 +0000 (UTC)

 Author: mav
 Date: Wed Jul  1 08:08:56 2009
 New Revision: 195231
 URL: http://svn.freebsd.org/changeset/base/195231
 
 Log:
   Fix infinite loop in ng_iface, that happens when packet passes out via
   two different ng interfaces sequentially due to tunnelling.
   
   PR:		kern/134557
   Submitted by:	Mikolaj Golub
   Approved by:	re (kensmith)
   MFC after:	3 days
 
 Modified:
   head/sys/netgraph/ng_iface.c
 
 Modified: head/sys/netgraph/ng_iface.c
 ==============================================================================
 --- head/sys/netgraph/ng_iface.c	Wed Jul  1 07:37:21 2009	(r195230)
 +++ head/sys/netgraph/ng_iface.c	Wed Jul  1 08:08:56 2009	(r195231)
 @@ -382,7 +382,8 @@ ng_iface_output(struct ifnet *ifp, struc
  	}
  
  	/* Protect from deadly infinite recursion. */
 -	while ((mtag = m_tag_locate(m, MTAG_NGIF, MTAG_NGIF_CALLED, NULL))) {
 +	mtag = NULL;
 +	while ((mtag = m_tag_locate(m, MTAG_NGIF, MTAG_NGIF_CALLED, mtag))) {
  		if (*(struct ifnet **)(mtag + 1) == ifp) {
  			log(LOG_NOTICE, "Loop detected on %s\n", ifp->if_xname);
  			m_freem(m);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: mav 
State-Changed-When: Sat Jul 4 06:01:31 UTC 2009 
State-Changed-Why:  
Patch committed and merged to 7-SATBLE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=134557 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/134557: commit references a PR
Date: Sat,  4 Jul 2009 06:01:15 +0000 (UTC)

 Author: mav
 Date: Sat Jul  4 06:00:57 2009
 New Revision: 195336
 URL: http://svn.freebsd.org/changeset/base/195336
 
 Log:
   MFC rev.195335:
   Fix infinite loop in ng_iface, that happens when packet passes out via
   two different ng interfaces sequentially due to tunnelling.
   
   PR:		kern/134557
   Submitted by:	Mikolaj Golub
 
 Modified:
   stable/7/sys/   (props changed)
   stable/7/sys/contrib/pf/   (props changed)
   stable/7/sys/netgraph/ng_iface.c
 
 Modified: stable/7/sys/netgraph/ng_iface.c
 ==============================================================================
 --- stable/7/sys/netgraph/ng_iface.c	Sat Jul  4 05:07:52 2009	(r195335)
 +++ stable/7/sys/netgraph/ng_iface.c	Sat Jul  4 06:00:57 2009	(r195336)
 @@ -365,7 +365,8 @@ ng_iface_output(struct ifnet *ifp, struc
  	}
  
  	/* Protect from deadly infinite recursion. */
 -	while ((mtag = m_tag_locate(m, MTAG_NGIF, MTAG_NGIF_CALLED, NULL))) {
 +	mtag = NULL;
 +	while ((mtag = m_tag_locate(m, MTAG_NGIF, MTAG_NGIF_CALLED, mtag))) {
  		if (*(struct ifnet **)(mtag + 1) == ifp) {
  			log(LOG_NOTICE, "Loop detected on %s\n", ifp->if_xname);
  			m_freem(m);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: "Z3tbl4 []" <z3tbl4@gmail.com>
To: bug-followup@FreeBSD.org, sergei.cherveni@gmail.com
Cc:  
Subject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