Re: [tcpm] On the implementation of TCP urgent data (IETF Internet Draft)

James Chacon <jmc@netbsd.org> Tue, 03 March 2009 15:24 UTC

Return-Path: <jmc@netbsd.org>
X-Original-To: tcpm@core3.amsl.com
Delivered-To: tcpm@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 45F023A67BD for <tcpm@core3.amsl.com>; Tue, 3 Mar 2009 07:24:18 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.468
X-Spam-Level:
X-Spam-Status: No, score=-2.468 tagged_above=-999 required=5 tests=[AWL=0.133, BAYES_00=-2.599, NO_RELAYS=-0.001]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mJqAvaoM844F for <tcpm@core3.amsl.com>; Tue, 3 Mar 2009 07:24:17 -0800 (PST)
Received: from mail.netbsd.org (mail.NetBSD.org [IPv6:2001:4f8:4:7:2e0:81ff:fe52:9ab6]) by core3.amsl.com (Postfix) with ESMTP id 459753A6452 for <tcpm@ietf.org>; Tue, 3 Mar 2009 07:24:17 -0800 (PST)
Received: from [IPv6:::1] (localhost [IPv6:::1]) by mail.netbsd.org (Postfix) with ESMTP id 2886263B101; Tue, 3 Mar 2009 15:24:42 +0000 (UTC)
Message-Id: <9C2D995C-D556-4669-86C6-68CF9C17F20F@netbsd.org>
From: James Chacon <jmc@netbsd.org>
To: Jerry Leichter <leichter@lrw.com>
In-Reply-To: <5D3A745D-9B59-4B31-87DB-23B29666A21D@lrw.com>
Content-Type: text/plain; charset="US-ASCII"; format="flowed"; delsp="yes"
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v930.3)
Date: Tue, 03 Mar 2009 09:24:41 -0600
References: <20090227222910.4AAF55654E@rebar.astron.com> <F2BD5C91-4566-487A-8CC0-D180C30B0058@old-ones.com> <2059A6D8-4BDA-44FF-827D-655814042138@netbsd.org> <5D3A745D-9B59-4B31-87DB-23B29666A21D@lrw.com>
X-Mailer: Apple Mail (2.930.3)
X-Mailman-Approved-At: Tue, 03 Mar 2009 08:08:09 -0800
Cc: groo@netbsd.org, tcpm@ietf.org, Christos Zoulas <christos@zoulas.com>, Bill Squier <groo@old-ones.com>, Fernando Gont <fernando@gont.com.ar>
Subject: Re: [tcpm] On the implementation of TCP urgent data (IETF Internet Draft)
X-BeenThere: tcpm@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TCP Maintenance and Minor Extensions Working Group <tcpm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/tcpm>, <mailto:tcpm-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tcpm>
List-Post: <mailto:tcpm@ietf.org>
List-Help: <mailto:tcpm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tcpm>, <mailto:tcpm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 03 Mar 2009 15:24:18 -0000

On Mar 3, 2009, at 7:24 AM, Jerry Leichter wrote:

> On Mar 2, 2009, at 11:19 PM, James Chacon wrote:
>> Actually we have seen leaks in-band when simply sending one byte at  
>> a time of OOB. It appears if the distance between 2 bytes exceeds  
>> the available OOB marker (which from memory was 16 bits) and  
>> nothing reads on the receiving end then on some impls the bytes  
>> leak in-band.
>>
>> We've seen that on linux and on Solaris to my recollection.
> I don't dispute the observations, but the explanation makes no sense  
> to me.  Yes, the Urgent Pointer is a 16-bit offset from the  
> beginning of the segment in which it appears (or something very much  
> like that).  It would make no sense to store the UP position as just  
> the 16-bit offset inside the implementation, since that's impossible  
> to interpret without the segment starting point.  The received  
> segment itself already has the (32 bit) position in the stream of  
> the segment, and the pair is unambiguous.  An implementation could  
> store the pair, but why?  The 32-bit sum of the UP and the segment  
> starting position is 2 bytes smaller and contains exactly the same  
> information.
>
> With bugs anything is possible, of course, but it's hard to see why  
> having the distance between successive OOB bytes being > 2^16 should  
> be significant in and of itself.  How was this tested?  Are you sure  
> it's really "gap > 2^16" or could it be "gap large enough" or  
> "enough data buffered"?  I can see this leading to the failure mode  
> that I described earlier:  User receiver hasn't read data for a long  
> time; receiving TCP lets its receive window close as it's running  
> out of buffer space; data piles up in sender's TCP stack buffers;  
> eventually we have two OOB bytes within the data to be sent; sender  
> doesn't keep track of this, or tries to send a segment with two OOB  
> bytes and can only encode one.
>                                                        -- Jerry
>

It's entirely possible your reasoning is also the cause. To be honest  
I never felt like diving into linux networking code to figure out the  
reason :)

I just know we have a reasonably reliable test which can replicate  
this on linux and the likelihood of seeing that fixed was low based on  
experiences with the select API and it's bugs.

James