[9144] in bugtraq
Re: NetBSD Security Advisory 1999-001: select(2)/accept(2)
daemon@ATHENA.MIT.EDU (Luigi Pugnetti)
Thu Jan 21 13:01:30 1999
Date: Wed, 20 Jan 1999 19:25:15 +0100
Reply-To: Luigi Pugnetti <pl@SYMBOLIC.IT>
From: Luigi Pugnetti <pl@SYMBOLIC.IT>
To: BUGTRAQ@NETSPACE.ORG
Luke Mewburn wrote:
>
> * Connection is initiated by client; 3WHS completes.
> * Server process is awakened and select(2) succeeds.
> * Connection is closed by client (e.g. by sending a RST). Connection
> is removed from accept(2) queue on server.
> * Server process does an accept(2), which hangs waiting for a
> connection.
>
> This scenario is sometimes difficult to reproduce, particularly if the
> server is very fast and the network is relatively slow. It is most
> effective if the server is slow and/or must do a lot of work between
> the select(2) and accept(2).
>
>
> 1) Modify all TCP servers to use non-blocking listening sockets.
> Unfortunately, this requires changing a large amount of code, much
> of it maintained by third parties.
This problem (and solution 1) was described by W. R. Stevens in Unix
Network Programming vol 1, second edition, sec. 15.6
--
Luigi Pugnetti