From owner-freebsd-net Thu Dec 19 9:31:40 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 86CA637B401 for ; Thu, 19 Dec 2002 09:31:38 -0800 (PST) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1220143E4A for ; Thu, 19 Dec 2002 09:31:38 -0800 (PST) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.3/8.12.3) with ESMTP id gBJHVRTK005347; Thu, 19 Dec 2002 09:31:27 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.3/8.12.3/Submit) id gBJHVRVS005346; Thu, 19 Dec 2002 09:31:27 -0800 Date: Thu, 19 Dec 2002 09:31:26 -0800 From: Brooks Davis To: Vincent Jardin Cc: freebsd-net@FreeBSD.ORG, Lars Eggert Subject: Re: Recursive encapsulation could panic the Kernel Message-ID: <20021219093126.B30203@Odin.AC.HMC.Edu> References: <3DF62DBD0032C2ED@mel-rta6.wanadoo.fr> <3E018315.5070602@isi.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="EuxKj2iCbKjpUGkD" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3E018315.5070602@isi.edu>; from larse@ISI.EDU on Thu, Dec 19, 2002 at 09:28:05AM +0100 X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --EuxKj2iCbKjpUGkD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > On 12/16/2002 9:45 PM, Vincent Jardin wrote: > >=20 > > With FreeBSD, there are many ways to create a recursive local encapsula= tion=20 > > loop within the IPv4 and IPv6 stack. > ... > > There is a simple local solution that is used by gif_output() that is n= ot=20 > > protected by any mutex: > .. > > if (++called > max_gif_nesting) { > > log(LOG_NOTICE, > > "gif_output: recursively called too many times(%d)\n", > > called); > > m_freem(m); > > error =3D EIO; /* is there better errno? */ > > goto end; > > } > >=20 > > I am wondering if a more generic solution could be found, however I do = not=20 > > have any idea yet ;-( Since we now have m_tag support, we could implement the solution OpenBSD uses which catches actual loops instead of just refusing to nest more then a certain amount. See sys/net/if_gif.c rev 1.19. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --EuxKj2iCbKjpUGkD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE+AgJsXY6L6fI4GtQRAml/AJ0Y44wjRBlocuGuH5FSkCvsiydFBACfWGmn HolDmI5PBToLu2hKEJdd+ns= =HixY -----END PGP SIGNATURE----- --EuxKj2iCbKjpUGkD-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message