From owner-cvs-src@FreeBSD.ORG Mon Apr 5 11:21:13 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 027F816A4CE; Mon, 5 Apr 2004 11:21:13 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C44643D3F; Mon, 5 Apr 2004 11:21:12 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.10/8.12.10) with ESMTP id i35IKwPq098721; Mon, 5 Apr 2004 14:20:59 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i35IKwIt098718; Mon, 5 Apr 2004 14:20:58 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Mon, 5 Apr 2004 14:20:58 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Ruslan Ermilov In-Reply-To: <20040405181653.GA1212@ip.net.ua> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Brooks Davis cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/net if_gif.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2004 18:21:13 -0000 On Mon, 5 Apr 2004, Ruslan Ermilov wrote: > On Wed, Mar 31, 2004 at 09:06:56AM -0500, Robert Watson wrote: > > > > On Wed, 31 Mar 2004, Ruslan Ermilov wrote: > > > > > > > Implemented this in the attached patch. Note when testing: setting > > > > > net.link.gif.max_nesting too high (>20 on my system) and triggering > > > > > the recursion causes the kernel stack exhaustion. > > > > > > > > Why not just do what OpenBSD does and do actual loop detection? This > > > > gets rid of the nesting count hack which isn't really what you want to > > > > measure anyway. > > > > > > > > http://www.openbsd.org/cgi-bin/cvsweb/src/sys/net/if_gif.c.diff?r1=1.18&r2=1.19 > > > > > > > Good idea. I will implement it and repost the updated patch here. > > > > While you're at it, we also need loop detection in if_gre. Make sure to > > check the IP- and IPv6-layer pieces of these as well. > > > Um, what do you mean, should I _check_ by running, or what? I was just pointing out that if you're looking for potential looping and recursion issues in the gif code, make sure you also look at the pieces of gif in the IP stack (as opposed to the generic network code) -- i.e., in_gif.c, ip_gre.c, etc. In fact, you probably want to grep around and look for any other consumers of the encapsulation APIs provided by ip_encap.c. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research