]> git.ipfire.org Git - thirdparty/tor.git/commit
guard: Ignore marked for close circuit when changing state to open
authorDavid Goulet <dgoulet@torproject.org>
Tue, 18 Jun 2019 17:32:45 +0000 (13:32 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Wed, 19 Jun 2019 11:42:30 +0000 (07:42 -0400)
commit16a0b7ed6779bf72a8a471c558a5e09084921d8b
tree16c7bf8cf75a30809d7a7319bb8cccc8f972af6c
parent125a6300da5412ce5fb2c0506f699e653a7ea6dc
guard: Ignore marked for close circuit when changing state to open

When we consider all circuits in "waiting for guard" state to be promoted to
an "open" state, we were considering all circuits, even the one marked for
close.

This ultiamtely triggers a "circuit_has_opened()" called on the circuit that
is marked for close which then leads to possible undesirable behaviors within
a subsystem.

For instance, the HS subsystem would be unable to find the authentication key
of the introduction point circuit leading to a BUG() warning and a duplicate
mark for close on the circuit.

This commit also adds a unit test to make sure we never select marked for
close circuits when upgrading its guard state from waiting for guard to open.

Fixes #30871

Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/ticket30871 [new file with mode: 0644]
src/feature/client/entrynodes.c
src/test/test_circuitbuild.c