[tor-bugs] #12450 [Tor]: Network down race condition might lead to primary guards getting skipped
Tor Bug Tracker & Wiki
blackhole at torproject.org
Mon Jun 23 23:38:34 UTC 2014
#12450: Network down race condition might lead to primary guards getting skipped
----------------------------------+---------------------
Reporter: asn | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: Tor | Version:
Keywords: tor-client tor-guard | Actual Points:
Parent ID: | Points:
----------------------------------+---------------------
The behavior at:
https://gitweb.torproject.org/tor.git/blob/d064773595f1d0bf1b76dd6f7439bff653a3c8ce:/src/or/entrynodes.c#l776
tries to ensure that if our network is down, and connections to already
existing guards fail, when the network is back up we will still try to
connect to the guards on the top of our list.
It does so, by checking whether the guard we connected to is a newly added
one. If it is so, it assumes that this guard was added because all our
previous guards were found to be down, which might be a sign of the
network being down. So if that's the case, the code walks our guard list
and marks all the previous guards as to be retried.
This usually works fine, but consider the case where we have 60 guards in
our guard list, and the network goes back up when we walk through the 50th
guard. If that's the case, the code at
https://gitweb.torproject.org/tor.git/blob/d064773595f1d0bf1b76dd6f7439bff653a3c8ce:/src/or/entrynodes.c#l776
doesn't get triggered because `first_contact` is not true, and we still
stay connected to the 50th guard.
This sounds like a bug, since we should try to connect to our primary
guards (the ones at the top of the list) even then.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/12450>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list