linux/net/dccp
Gerrit Renker a94f0f9705 [DCCP]: Rate-limit DCCP-Syncs
This implements a SHOULD from RFC 4340, 7.5.4:
 "To protect against denial-of-service attacks, DCCP implementations SHOULD
  impose a rate limit on DCCP-Syncs sent in response to sequence-invalid packets,
  such as not more than eight DCCP-Syncs per second."

The rate-limit is maintained on a per-socket basis. This is a more stringent
policy than enforcing the rate-limit on a per-source-address basis and
protects against attacks with forged source addresses.

Moreover, the mechanism is deliberately kept simple. In contrast to
xrlim_allow(), bursts of Sync packets in reply to sequence-invalid packets
are not supported.  This foils such attacks where the receipt of a Sync
triggers further sequence-invalid packets. (I have tested this mechanism against
xrlim_allow algorithm for Syncs, permitting bursts just increases the problems.)

In order to keep flexibility, the timeout parameter can be set via sysctl; and
the whole mechanism can even be disabled (which is however not recommended).

The algorithm in this patch has been improved with regard to wrapping issues
thanks to a suggestion by Arnaldo.

Commiter note: Rate limited the step 6 DCCP_WARN too, as it says we're
               sending a sync.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
2007-10-10 16:52:43 -07:00
..
ccids [CCID3]: Move NULL-protection into function 2007-10-10 16:52:41 -07:00
ackvec.c [NET]: DIV_ROUND_UP cleanup (part two) 2007-10-10 16:48:37 -07:00
ackvec.h [DCCP] ackvec: Convert to ktime_t 2007-10-10 16:48:14 -07:00
ccid.c [DCCP]: fix theoretical ccids_{read,write}_lock() race 2007-08-13 22:52:09 -07:00
ccid.h [DCCP] ccid: Deprecate ccid_hc_tx_insert_options 2006-12-11 14:34:49 -08:00
dccp.h [DCCP]: Rate-limit DCCP-Syncs 2007-10-10 16:52:43 -07:00
diag.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
feat.c [DCCP]: fix memory leak and clean up style - dccp_feat_empty_confirm() 2007-08-13 22:52:10 -07:00
feat.h [NET] DCCP: Fix whitespace errors. 2007-02-10 23:19:27 -08:00
input.c [DCCP]: Rate-limit DCCP-Syncs 2007-10-10 16:52:43 -07:00
ipv4.c [DCCP]: Remove unneeded pointer newdp from dccp_v4_request_recv_sock() 2007-10-10 16:48:59 -07:00
ipv6.c [IPV6]: Do not send RH0 anymore. 2007-07-10 22:55:49 -07:00
ipv6.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
Kconfig [DCCP]: Use menuconfig objects. 2007-05-24 16:36:46 -07:00
Makefile [DCCPv6]: Resolve conditional build problem 2006-12-02 21:22:28 -08:00
minisocks.c [DCCP]: Nuke dccp_timestamp and dccps_epoch, not used anymore 2007-10-10 16:48:17 -07:00
options.c [DCCP]: Provide 10s of microsecond timesource 2007-10-10 16:52:35 -07:00
output.c [DCCP]: Remove duplicate code for Reset from connected socket 2007-10-10 16:52:42 -07:00
probe.c [NET]: Make /proc/net per network namespace 2007-10-10 16:49:06 -07:00
proto.c [DCCP]: Rate-limit DCCP-Syncs 2007-10-10 16:52:43 -07:00
sysctl.c [DCCP]: Rate-limit DCCP-Syncs 2007-10-10 16:52:43 -07:00
timer.c [DCCP]: Provide 10s of microsecond timesource 2007-10-10 16:52:35 -07:00