]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
conflux: Don't process a closed circuit on get packaged window
authorDavid Goulet <dgoulet@torproject.org>
Mon, 15 Apr 2024 18:45:29 +0000 (14:45 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Mon, 15 Apr 2024 18:45:29 +0000 (14:45 -0400)
Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/ticket40908 [new file with mode: 0644]
src/core/or/conflux_util.c

diff --git a/changes/ticket40908 b/changes/ticket40908
new file mode 100644 (file)
index 0000000..28cd3f0
--- /dev/null
@@ -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.
+
index 31ab983f8f393d2523ee4a154d19297000c60af7..4277424ec8b4d9f41448e7a0c609e0d45cedbc22 100644 (file)
@@ -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 ==