freebsd-dev/lib/libc
Bill Paul a6e95b4420 Improve DoS avoidance in RPC stream oriented transports. The TCP transport
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.
1998-05-18 16:12:13 +00:00
..
alpha Remove a big hack after adding a small one to libc/gen/getcwd.c to 1998-05-15 12:01:06 +00:00
amd64 Use the thread-aware errno definition all the time. 1998-05-05 22:07:02 +00:00
compat-43 Don't imply sigset_t == int. 1998-05-03 22:27:29 +00:00
db Sorted lists. 1997-10-21 08:41:15 +00:00
gen NetBSD doesn't have a __getcwd syscall, so set have__getcwd to `no' 1998-05-15 11:59:00 +00:00
gmon These files are very specific to FreeBSD kernels, so silently compile 1998-03-09 04:42:19 +00:00
i386 Use the thread-aware errno definition all the time. 1998-05-05 22:07:02 +00:00
include Remove leading underscores from the FILE lock functions that POSIX 1998-05-05 22:02:29 +00:00
locale Add reference to catopen(3) 1998-04-30 16:07:54 +00:00
net Resolve some unexpected differences when comparing with the 2.2 version. 1998-05-02 15:51:54 +00:00
nls Add reference to setlocale(3) 1998-04-30 16:11:50 +00:00
quad Change MACHINE references to MACHINE_ARCH. 1998-02-20 08:23:55 +00:00
regex int -> long changes that reduce the diffs with the NetBSD version to 1998-05-14 21:45:18 +00:00
rpc Improve DoS avoidance in RPC stream oriented transports. The TCP transport 1998-05-18 16:12:13 +00:00
stdio Remote the NetBSD kludge for vfprintf.c 1998-05-08 05:17:11 +00:00
stdlib This is a hack to workaround source that is coded to use long variables 1998-05-08 05:41:57 +00:00
stdtime Remove 'of type long' from a sentence talking about four 4-byte values 1998-05-10 21:21:01 +00:00
string Cast a pointer to a long, not an int before masking it. 1998-05-10 21:22:47 +00:00
sys kill.1: Remove reference to obsolete sigvec(2) man page. Removed 1998-05-18 03:33:11 +00:00
xdr Patch RPC library to avoid possible denial of service attacks as described 1998-05-15 22:57:31 +00:00
yp Fixed the usual missing dependencies on headers generated by rpcgen. 1998-05-09 15:10:53 +00:00
Makefile Add an include path to private linc/libc_r/libpthread header files. 1998-03-09 06:16:38 +00:00
Makefile.inc Define empty variables in case no names are added to them. This avoids 1998-03-09 06:21:41 +00:00