Bill Fenner 764d8cef56 A more complete fix for the "land" attack, removing the "quick fix" from
rev 1.66.  This fix contains both belt and suspenders.

Belt: ignore packets where src == dst and srcport == dstport in TCPS_LISTEN.
 These packets can only legitimately occur when connecting a socket to itself,
 which doesn't go through TCPS_LISTEN (it goes CLOSED->SYN_SENT->SYN_RCVD->
 ESTABLISHED).  This prevents the "standard" "land" attack, although doesn't
 prevent the multi-homed variation.

Suspenders: send a RST in response to a SYN/ACK in SYN_RECEIVED state.
 The only packets we should get in SYN_RECEIVED are
 1. A retransmitted SYN, or
 2. An ack of our SYN/ACK.
 The "land" attack depends on us accepting our own SYN/ACK as an ACK;
 in SYN_RECEIVED state; this should prevent all "land" attacks.

We also move up the sequence number check for the ACK in SYN_RECEIVED.
 This neither helps nor hurts with respect to the "land" attack, but
 puts more of the validation checking in one spot.

PR:             kern/5103
1998-01-21 02:05:59 +00:00
..
1997-11-16 05:55:52 +00:00
1998-01-08 23:42:31 +00:00
1997-05-09 07:48:14 +00:00
1998-01-08 23:42:31 +00:00
1998-01-08 23:42:31 +00:00
1997-08-02 14:33:27 +00:00
1998-01-08 23:42:31 +00:00
1997-11-16 05:55:52 +00:00
1997-11-16 05:55:52 +00:00
1997-05-25 15:50:46 +00:00
1998-01-08 23:42:31 +00:00
1997-11-16 05:55:52 +00:00
1997-10-28 15:59:26 +00:00
1997-11-16 05:55:52 +00:00
1997-11-16 05:55:52 +00:00
1997-05-25 15:50:46 +00:00
1997-05-25 15:50:46 +00:00
1998-01-08 23:42:31 +00:00
1997-09-16 18:36:06 +00:00