summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2012-07-01 05:32:37 -0400
committerRoger Dingledine <arma@torproject.org>2012-07-01 05:32:37 -0400
commit6061cd584c129eb8b5ed24fb5ce686a0236913e4 (patch)
treecc88fa612f14f9fe667950fa552e4dfadd064b8f
parented2601f2be0978c37c0ae086b2a8d2f7d94078fc (diff)
parentc32ec9c425e9539bcc8ede95612e2d331c2cc2dd (diff)
downloadtor-6061cd584c129eb8b5ed24fb5ce686a0236913e4.tar.gz
tor-6061cd584c129eb8b5ed24fb5ce686a0236913e4.zip
Merge branch 'maint-0.2.3'
-rw-r--r--changes/bug62528
-rw-r--r--src/or/relay.c14
2 files changed, 22 insertions, 0 deletions
diff --git a/changes/bug6252 b/changes/bug6252
new file mode 100644
index 0000000000..0d29203fab
--- /dev/null
+++ b/changes/bug6252
@@ -0,0 +1,8 @@
+ o Security fixes:
+ - Tear down the circuit if we get an unexpected SENDME cell. Clients
+ could use this trick to make their circuits receive cells faster
+ than our flow control would have allowed, or to gum up the network,
+ or possibly to do targeted memory denial-of-service attacks on
+ entry nodes. Fixes bug 6252. Bugfix on the 54th commit on Tor --
+ from July 2002, before the release of Tor 0.0.0.
+
diff --git a/src/or/relay.c b/src/or/relay.c
index 3f894bfe1f..4ab440384f 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -1265,11 +1265,25 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ,
case RELAY_COMMAND_SENDME:
if (!conn) {
if (layer_hint) {
+ if (layer_hint->package_window + CIRCWINDOW_INCREMENT >
+ CIRCWINDOW_START_MAX) {
+ log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
+ "Bug/attack: unexpected sendme cell from exit relay. "
+ "Closing circ.");
+ return -END_CIRC_REASON_TORPROTOCOL;
+ }
layer_hint->package_window += CIRCWINDOW_INCREMENT;
log_debug(LD_APP,"circ-level sendme at origin, packagewindow %d.",
layer_hint->package_window);
circuit_resume_edge_reading(circ, layer_hint);
} else {
+ if (circ->package_window + CIRCWINDOW_INCREMENT >
+ CIRCWINDOW_START_MAX) {
+ log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
+ "Bug/attack: unexpected sendme cell from client. "
+ "Closing circ.");
+ return -END_CIRC_REASON_TORPROTOCOL;
+ }
circ->package_window += CIRCWINDOW_INCREMENT;
log_debug(LD_APP,
"circ-level sendme at non-origin, packagewindow %d.",