Slipping in the window update

Don Lewis truckman at FreeBSD.org
Mon Jan 10 02:46:52 PST 2005


On 10 Jan, Mike Silbersack wrote:
> 
> On Mon, 10 Jan 2005, Don Lewis wrote:
> 
>> Now that I've looked at the above case, it looks to me like your
>> suggested patch might affect the response to a legitimate duplicate SYN.
>> It will definitely follow a different code path.
> 
> You're right, I neglected to handle the duplicate SYN case.
> 
> Couldn't we centralize all SYN handling right after trimthenstep6:?
> 
> We could do something there like
> 
> if (th->th_seq != tp->irs) {
>  	goto dropafterack; /* Or however we handle these bad syns */
> } else {
> thflags &= ~TH_SYN;
> th->th_seq++;
> if (th->th_urp > 1)
>  	th->th_urp--;
> else
>  	thflags &= ~TH_URG;
> todrop--;
> }

My thinking is that the security problem is confined to the following
block of code:

        /*
         * If a SYN is in the window, then this is an
         * error and we send an RST and drop the connection.
         */
        if (thflags & TH_SYN) {
                tp = tcp_drop(tp, ECONNRESET);
                rstreason = BANDLIM_UNLIMITED;
                goto drop;
        }

and that to implement the recommendation in the Internet Draft, it is
only necessary to change the actions taken inside this "if" block.

If response rate limiting is implemented, I'd actually prefer a more
general solution that is at least somewhat independent of the SYN flag,
since if the goal of an attacker is to cause an flood of ACK responses,
he can just as easily trigger it by sending spoofed packets that don't
have the SYN flag set.  The SYN flag could be used as a hint, but the
solution should be more general.



More information about the freebsd-net mailing list