[tor-commits] [tor/master] Bug 29034: Cleanup hs circuitmap when purpose changes.

2019-08-11 Thread teor
commit a6399da598101d8046cbf7ab2d80051fd8820e2f
Author: Mike Perry 
Date:   Wed Jun 5 11:50:44 2019 -0700

Bug 29034: Cleanup hs circuitmap when purpose changes.

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 | 5 +
 src/core/or/circuituse.c | 6 ++
 2 files changed, 11 insertions(+)

diff --git a/changes/bug29034 b/changes/bug29034
new file mode 100644
index 0..e7aa9af00
--- /dev/null
+++ b/changes/bug29034
@@ -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.
diff --git a/src/core/or/circuituse.c b/src/core/or/circuituse.c
index 02bfa15fb..000a7c36d 100644
--- a/src/core/or/circuituse.c
+++ b/src/core/or/circuituse.c
@@ -3066,6 +3066,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;



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Bug 29034: Cleanup hs circuitmap when purpose changes.

2019-06-05 Thread nickm
commit c525135dac354892a45ad3d2f6de9450d393f09f
Author: Mike Perry 
Date:   Wed Jun 5 11:50:44 2019 -0700

Bug 29034: Cleanup hs circuitmap when purpose changes.

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 | 5 +
 src/core/or/circuituse.c | 6 ++
 2 files changed, 11 insertions(+)

diff --git a/changes/bug29034 b/changes/bug29034
new file mode 100644
index 0..e7aa9af00
--- /dev/null
+++ b/changes/bug29034
@@ -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.
diff --git a/src/core/or/circuituse.c b/src/core/or/circuituse.c
index 485c38905..18b419e99 100644
--- a/src/core/or/circuituse.c
+++ b/src/core/or/circuituse.c
@@ -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;



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits