aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2024-04-15 15:11:16 -0400
committerDavid Goulet <dgoulet@torproject.org>2024-04-15 15:11:16 -0400
commit29e3601c4249094e010c49e55e8bcd5769b4eb57 (patch)
treeb3aadcee70d8abe876a4334764ac54c3109672bd
parent269b4561a17698732c6402e2b7a8aeb1f8e3c3bf (diff)
parent612b801ea53cd0b318e3bf88da5bb5de6b507226 (diff)
downloadtor-29e3601c4249094e010c49e55e8bcd5769b4eb57.tar.gz
tor-29e3601c4249094e010c49e55e8bcd5769b4eb57.zip
Merge branch 'tor-gitlab/mr/808' into maint-0.4.8
-rw-r--r--changes/ticket409085
-rw-r--r--src/core/or/conflux_util.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/changes/ticket40908 b/changes/ticket40908
new file mode 100644
index 0000000000..28cd3f0f36
--- /dev/null
+++ b/changes/ticket40908
@@ -0,0 +1,5 @@
+ o Minor bugfixes (conflux):
+ - Make sure we don't process a closed circuit when packaging data. This lead
+ to a non fatal BUG() spamming logs. Fixes bug 40908; bugfix on
+ 0.4.8.1-alpha.
+
diff --git a/src/core/or/conflux_util.c b/src/core/or/conflux_util.c
index 31ab983f8f..4277424ec8 100644
--- a/src/core/or/conflux_util.c
+++ b/src/core/or/conflux_util.c
@@ -33,6 +33,13 @@ int
circuit_get_package_window(circuit_t *circ,
const crypt_path_t *cpath)
{
+ /* We believe it is possible to get a closed circuit related to the
+ * on_circuit pointer of a connection not being nullified before ending up
+ * here. Else, this can lead to loud bug like experienced in #40908. */
+ if (circ->marked_for_close) {
+ return 0;
+ }
+
if (circ->conflux) {
if (CIRCUIT_IS_ORIGIN(circ)) {
tor_assert_nonfatal(circ->purpose ==