]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
hs: Avoid possible double circuit close on error
authorDavid Goulet <dgoulet@torproject.org>
Thu, 21 Sep 2017 17:13:44 +0000 (13:13 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 21 Sep 2017 18:38:43 +0000 (14:38 -0400)
Fixes #23610

Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/bug23610 [new file with mode: 0644]
src/or/hs_intropoint.c

diff --git a/changes/bug23610 b/changes/bug23610
new file mode 100644 (file)
index 0000000..f2dc8bd
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (hidden service, relay):
+    - Avoid a possible double close of a circuit by the intro point on error
+      of sending the INTRO_ESTABLISHED cell. Fixes ticket 23610; bugfix on
+      0.3.0.1-alpha.
index 636b345b5b69b4b4fe8cdb23e607629a89896057..06f8a2c3adcd8dd9e71c62b39aede8af3caedaa0 100644 (file)
@@ -254,7 +254,11 @@ handle_establish_intro(or_circuit_t *circ, const uint8_t *request,
   goto done;
 
  err:
-  circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_TORPROTOCOL);
+  /* When sending the intro establish ack, on error the circuit can be marked
+   * as closed so avoid a double close. */
+  if (!TO_CIRCUIT(circ)->marked_for_close) {
+    circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_TORPROTOCOL);
+  }
 
  done:
   trn_cell_establish_intro_free(parsed_cell);