]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Bug 29034: Cleanup hs circuitmap when purpose changes.
authorMike Perry <mikeperry-git@torproject.org>
Wed, 5 Jun 2019 18:50:44 +0000 (11:50 -0700)
committerMike Perry <mikeperry-git@torproject.org>
Wed, 5 Jun 2019 18:50:44 +0000 (11:50 -0700)
Leave the other rend and hs_ident data around until circuit free, since code
may still try to inspect it after marking the circuit for close. The
circuitmap is the important thing to clean up, since repurposed
intropoints must be removed from this map to ensure validity.

changes/bug29034 [new file with mode: 0644]
src/core/or/circuituse.c

diff --git a/changes/bug29034 b/changes/bug29034
new file mode 100644 (file)
index 0000000..e7aa9af
--- /dev/null
@@ -0,0 +1,5 @@
+  o Major bugfixes (Onion service reachability):
+    - Properly clean up the introduction point map when circuits change purpose
+      from onion service circuits to pathbias, measurement, or other circuit types.
+      This should fix some service-side instances of introduction point failure.
+      Fixes bug 29034; bugfix on 0.3.2.1-alpha.
index 485c3890542a554f179489b4ac2bee4abe91ffd7..18b419e99d7472a38a988d2d2d7ece54a4c35e01 100644 (file)
@@ -3082,6 +3082,12 @@ circuit_change_purpose(circuit_t *circ, uint8_t new_purpose)
               circ->purpose,
               circuit_purpose_to_string(new_purpose),
               new_purpose);
+
+    /* Take specific actions if we are repurposing a hidden service circuit. */
+    if (circuit_purpose_is_hidden_service(circ->purpose) &&
+        !circuit_purpose_is_hidden_service(new_purpose)) {
+      hs_circ_cleanup(circ);
+    }
   }
 
   old_purpose = circ->purpose;