Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Apr 2004 13:02:43 +0300
From:      Ruslan Ermilov <ru@freebsd.org>
To:        Brooks Davis <brooks@one-eyed-alien.net>
Cc:        cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/net if_gif.c
Message-ID:  <20040404100243.GA16434@ip.net.ua>
In-Reply-To: <20040404051126.GA22393@Odin.AC.HMC.Edu>
References:  <200403221424.i2MEOQYK057524@repoman.freebsd.org> <20040330220349.GA97921@ip.net.ua> <20040330232517.GA19416@Odin.AC.HMC.Edu> <20040331072756.GA14337@ip.net.ua> <20040403085651.GA96868@ip.net.ua> <20040404051126.GA22393@Odin.AC.HMC.Edu>

next in thread | previous in thread | raw e-mail | index | archive | help

--vkogqOf2sHV7VnPd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Apr 03, 2004 at 09:11:26PM -0800, Brooks Davis wrote:
> On Sat, Apr 03, 2004 at 11:56:51AM +0300, Ruslan Ermilov wrote:
> > On Wed, Mar 31, 2004 at 10:27:56AM +0300, Ruslan Ermilov wrote:
> > > On Tue, Mar 30, 2004 at 03:25:17PM -0800, Brooks Davis wrote:
> > > > On Wed, Mar 31, 2004 at 01:03:49AM +0300, Ruslan Ermilov wrote:
> > > > > On Mon, Mar 22, 2004 at 06:24:26AM -0800, Robert Watson wrote:
> > > > > > rwatson     2004/03/22 06:24:26 PST
> > > > > >=20
> > > > > >   FreeBSD src repository
> > > > > >=20
> > > > > >   Modified files:
> > > > > >     sys/net              if_gif.c=20
> > > > > >   Log:
> > > > > >   Move "called", a static function variable used to detect recu=
rsive
> > > > > >   processing with gif interfaces, to a global variable named "g=
if_called".
> > > > > >   Add an annotation that this approach will not work with a ree=
ntrant
> > > > > >   network stack, and that we should instead use packet tags to =
detect
> > > > > >   excessive recursive processing.
> > > > > >  =20
> > > > > >   Revision  Changes    Path
> > > > > >   1.42      +11 -4     src/sys/net/if_gif.c
> > > > > >=20
> > > > > Implemented this in the attached patch.  Note when testing: setti=
ng
> > > > > net.link.gif.max_nesting too high (>20 on my system) and triggeri=
ng
> > > > > the recursion causes the kernel stack exhaustion.
> > > >=20
> > > > Why not just do what OpenBSD does and do actual loop detection?  Th=
is
> > > > gets rid of the nesting count hack which isn't really what you want=
 to
> > > > measure anyway.
> > > >=20
> > > > http://www.openbsd.org/cgi-bin/cvsweb/src/sys/net/if_gif.c.diff?r1=
=3D1.18&r2=3D1.19
> > > >=20
> > > Good idea.  I will implement it and repost the updated patch here.
> > >=20
> > Actually, just replacing nesting limiter with loop detection was a
> > bad idea, so I didn't follow it.  It's a bad idea because you might
> > have many nesting (but not looping) gif interfaces, and this will
> > still cause panic by exhausting the kernel stack.  Instead, I have
> > combined both checks.  Please review the attached patch.
>=20
> Unless you can automaticly choose a valid value for max_gif_nesting, I
> think it should be taken out and shot.  Unless you can do that, there's
> nothing you can do to prevent the admin from making a configuration that
> blows out the stack so why keep the extra annoyance of gif_max_nest
> around?  It won't do anything to prevent the panic and will break things
> in perfectly valid cases.  If we're really worried about the stack
> issue, forcing a requeue instead of processing to completion any time
> we're nested makes more sense to me.
>=20
Unfortunately, there's no such thing as the IP output queue.  Anyway,
I'm going to commit my version now.  If you want to shot the nesting
limit, I'm fine with it, but please _you_ do it.  ;)


Cheers,
--=20
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

--vkogqOf2sHV7VnPd
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAb91DUkv4P6juNwoRAq0WAJ9KZaep3qcYkCFFfAryo04OoQATQgCfVhq/
GtqyHCvsUt3KuLLxkYbrXh4=
=ifzQ
-----END PGP SIGNATURE-----

--vkogqOf2sHV7VnPd--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040404100243.GA16434>