summaryrefslogtreecommitdiff
path: root/lib/libc/rpc/svc_unix.c
Commit message (Collapse)AuthorAgeFilesLines
* Improve DoS avoidance in RPC stream oriented transports. The TCP transportBill Paul1998-05-181-17/+35
| | | | | | | | | | | | | | | | | | | | | | | | | uses readtcp() to gather data from the network; readtcp() uses select(), with a timeout of 35 seconds. The problem with this is that if you connect to a TCP server, send two bytes of data, then just pause, the server will remain blocked in readtcp() for up to 35 seconds, which is sort of a long time. If you keep doing this every 35 seconds, you can keep the server occupied indefinitely. To fix this, I modified readtcp() (and its cousin, readunix() in svc_unix.c) to monitor all service transport handles instead of just the current socket. This allows the server to keep handling new connections that arrive while readtcp() is running. This prevents one client from potentially monopolizing a server. Also, while I was here, I fixed a bug in the timeout calculations. Someone attempted to adjust the timeout so that if select() returned EINTR and the loop was restarted, the timeout would be reduced so that rather than waiting for another 35 seconds, you could never wait for more than 35 seconds total. Unfortunately, the calculation was wrong, and the timeout could expire much sooner than 35 seconds. Notes: svn path=/head/; revision=36156
* Patch RPC library to avoid possible denial of service attacks as describedBill Paul1998-05-151-1/+2
| | | | | | | | | recently in BUGTRAQ. If a stream oriented transport fails to properly decode an RPC message header structure where there should be one, it should mark the stream as dead so that the connection will be dropped. Notes: svn path=/head/; revision=36086
* Now the biggest step: import the changes to the main RPC code.Bill Paul1997-05-281-0/+511
Note: you'll need to rinstalkl all your includes before compiling libc the next time you update your sources in order for all this to work. Reviewed by: Mark Murray Notes: svn path=/cvs2svn/branches/WPAUL/dist/; revision=26219