From: David Goulet Date: Thu, 21 Sep 2017 17:13:44 +0000 (-0400) Subject: hs: Avoid possible double circuit close on error X-Git-Tag: tor-0.3.1.8~18^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7f3dc8327ac1f6b4a0ec377b5ec04e279b682cab;p=thirdparty%2Ftor.git hs: Avoid possible double circuit close on error Fixes #23610 Signed-off-by: David Goulet --- diff --git a/changes/bug23610 b/changes/bug23610 new file mode 100644 index 0000000000..f2dc8bd1a6 --- /dev/null +++ b/changes/bug23610 @@ -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. diff --git a/src/or/hs_intropoint.c b/src/or/hs_intropoint.c index 636b345b5b..06f8a2c3ad 100644 --- a/src/or/hs_intropoint.c +++ b/src/or/hs_intropoint.c @@ -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);