From owner-freebsd-net@FreeBSD.ORG Tue Aug 28 09:26:02 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 500D616A421 for ; Tue, 28 Aug 2007 09:26:02 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [62.111.66.27]) by mx1.freebsd.org (Postfix) with ESMTP id C892F13C428 for ; Tue, 28 Aug 2007 09:26:01 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from localhost (amavis.str.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 2C4F141C707; Tue, 28 Aug 2007 11:26:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([62.111.66.27]) by localhost (amavis.str.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id UICBVl190Laz; Tue, 28 Aug 2007 11:25:59 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id C578541C729; Tue, 28 Aug 2007 11:25:59 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id B068F444885; Tue, 28 Aug 2007 09:25:49 +0000 (UTC) Date: Tue, 28 Aug 2007 09:25:49 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: blue In-Reply-To: <46D3B747.1090903@zyxel.com.tw> Message-ID: <20070828092348.Y87821@maildrop.int.zabbadoz.net> References: <46D38543.4020507@zyxel.com.tw> <46D3B747.1090903@zyxel.com.tw> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-net@freebsd.org Subject: Re: infinite loop in esp6_ctlinput()? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2007 09:26:02 -0000 On Tue, 28 Aug 2007, blue wrote: Hi, > Since our device adopts the IPsec codes from BSD, our device will have > infinite loop after receiving ICMP packet too big message. > I am not sure whether BSD itself will have the problem or not (maybe needs > further testing). In IPSEC, esp6_ctlinput() still calls pfctlinput2(), which > is the root cause of the infinite loop. you were talking about IPSEC vs. FAST_IPSEC so I guess you are on RELENG_6 or is that HEAD. Would be helpful to know where exactly (though I guess looking at the code I could find out). Is it the problem reported here[1] that you are describing? /bz [1] http://lists.freebsd.org/pipermail/freebsd-current/2007-August/076478.html > Best regards, > > Yi-Wen > > JINMEI Tatuya / ???? wrote: > >> At Tue, 28 Aug 2007 10:15:31 +0800, >> blue wrote: >> >> >>> When receiving a "packet too big" ICMP error message, FreeBSD will call >>> the ctlinput() function of the upper protocol. If the preceding packet is >>> an ESP IPv6 packet, then FreeBSD will call esp6_ctlinput(). In >>> esp6_ctlinput(), pfctlinput2() will be executed to traverse all possible >>> upper protocols, and call their registered ctlinput() function. However, >>> that would call esp6_ctlinput() again since ESP is one of the upper >>> protocols! Then an infinite loop occurs!! >>> >> >> From a quick look at the code, there's a slight difference between the >> IPSEC (netinet6/esp_input.c) and FAST_IPSEC (netipsec/ipsec_input.c) >> implementations. I suspect the loop doesn't occur at least for the >> esp_input.c version. Did you actually see the loop for both, or are >> you guessing from the code? >> >> >>> After comparing both IPSEC and FAST_IPSEC, the operations are exactly the >>> same. Is it a bug? >>> >> >> If it actually causes an infinite loop, it's a bug, of course. >> >> JINMEI, Tatuya >> Communication Platform Lab. >> Corporate R&D Center, Toshiba Corp. >> jinmei@isl.rdc.toshiba.co.jp >> >> > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > -- Bjoern A. Zeeb bzeeb at Zabbadoz dot NeT Software is harder than hardware so better get it right the first time.