Re: Socket stuck in CLOSE_WAIT state

pwhiting@fury.ittc.ukans.edu
Fri, 30 Apr 1999 09:39:46 -0500


The TCP state transition diagram (the one I have) shows the
CLOSE_WAIT state as being entered upon receiving a FIN from
the other side. We ACK that FIN - now we are in CLOSE_WAIT.
However, getting out of CLOSE_WAIT is up to **us** - we do a
close to the application and send a FIN back to the other side.
We now are in LAST_ACK which is where we are waiting for the
ACK to come back in response to our FIN. This is where I would
anticipate being stuck by a DOS attack. It should be handled
in the same way getting stuck in FIN_WAIT_2 is - quoting from
Stevens TCP/IP Illustrated vol2 p827:

"Terminating an idle connection after more than 10 minutes in
the FIN_WAIT_2 state violates the protocol specification, but
is practical. [...snip...] If the other process never closes its
end of the connection, our end can remain in the FIN_WAIT_2
forever. A counter should be maintained for the number of
connections terminated for this reason, to see how often this
occurs."

pete

On Mon, Apr 26, 1999 at 11:30:22PM +0100, Alex Buell wrote:
> There's a DoS attack going around on the net: this particular attack
> focuses on IDENT (port 113) and leaves sockets in CLOSE_WAIT state.
>
> Here's an example (from netstat -ntu)
>
> tcp 34 0 194.222.9.116:113 204.60.30.67:1386 CLOSE_WAIT
>
> Seems if there's data in the queue, the socket will never close.
> This is on 2.2.6.
>
> Someone else reported the same thing with 2.2.5, he had a socket in
> CLOSE_WAIT over 7 days!
>
> Cheers,
> Alex
> --
> "A mind opened by new ideas can never return to its original limits"
>
> http://www.tahallah.demon.co.uk
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.tux.org/lkml/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/