From owner-freebsd-security Fri Jan 21 18:17:32 2000 Delivered-To: freebsd-security@freebsd.org Received: from ind.alcatel.com (postal.xylan.com [208.8.0.248]) by hub.freebsd.org (Postfix) with ESMTP id 9A54715183 for ; Fri, 21 Jan 2000 18:17:29 -0800 (PST) (envelope-from wes@softweyr.com) Received: from mailhub.xylan.com (mailhub [198.206.181.70]) by ind.alcatel.com (8.9.3+Sun/8.9.1 (ind.alcatel.com 3.0 [OUT])) with SMTP id SAA24083; Fri, 21 Jan 2000 18:15:39 -0800 (PST) X-Origination-Site: Received: from omni.xylan.com by mailhub.xylan.com (SMI-8.6/SMI-SVR4 (mailhub 2.1 [HUB])) id SAA27909; Fri, 21 Jan 2000 18:15:39 -0800 Received: from softweyr.com (dyn1.utah.xylan.com [198.206.184.237]) by omni.xylan.com (8.9.3+Sun/8.9.1 (Xylan engr [SPOOL])) with ESMTP id SAA17315; Fri, 21 Jan 2000 18:14:16 -0800 (PST) Message-ID: <388913CF.DE7F4B0B@softweyr.com> Date: Fri, 21 Jan 2000 19:19:59 -0700 From: Wes Peters Organization: Softweyr LLC X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 3.3-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Poul-Henning Kamp Cc: Matthew Dillon , Alfred Perlstein , Brett Glass , security@freebsd.org Subject: Re: stream.c worst-case kernel paths References: <7192.948496931@critter.freebsd.dk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Poul-Henning Kamp wrote: > > In message <200001212311.PAA64559@apollo.backplane.com>, Matthew Dillon writes: > > > No, this is far too dangerous. If a packet is bad due to being > > corrupted then you want to throw it away (via the checksum check) > > *BEFORE* you start messing around with the socket state. Otherwise > > a perfectly legitimate packet that got corrupted in transit may > > cause a disconnect or other failure. > > It makes a lot of sense to do cheap (relative to the checksum) > checks on the packet before we do the checksum, as long as we > don't modify any state before the checksum is validated. > > If it is cheaper to try to locate the pcb, than to calculate the > checksum, the locate the pcb first and drop the packet before > doing the checksum. Except you may get a false match on a garbled packet, that just happened to get garbled to match a different connection. The checksum is done first to avoid such situations. Until the packet has been verified good, none of the data in it can be trusted. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC wes@softweyr.com http://softweyr.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message