tor/changes
David Goulet 218f9f90fb guard: Don't check bridge transport name when selecting eligible guards
This is related to ticket #40360 which found this problem when a Bridge entry
with a transport name (let say obfs4) is set without a fingerprint:

  Bridge obfs4 <IP>:<PORT> cert=<...> iat-mode=0

(Notice, no fingerprint between PORT and "cert=")

Problem: commit 09c6d03246 added a check in
get_sampled_guard_for_bridge() that would return NULL if the selected bridge
did not have a valid transport name (that is the Bridge transport name that
corresponds to a ClientTransportPlugin).

Unfortuantely, this function is also used when selecting our eligible guards
which is done *before* the transport list is populated and so the added check
for the bridge<->transport name is querying an empty list of transports
resulting in always returning NULL.

For completion, the logic is: Pick eligible guards (use bridge(s) if need be)
then for those, initiate a connection to the pluggable transport proxy and
then populate the transport list once we've connected.

Back to get_sampled_guard_for_bridge(). As said earlier, it is used when
selecting our eligible guards in a way that prevents us from selecting
duplicates. In other words, if that function returns non-NULL, the selection
continues considering the bridge was sampled before. But if it returns NULL,
the relay is added to the eligible list.

This bug made it that our eligible guard list was populated with the *same*
bridge 3 times like so (remember no fingerprint):

  [info] entry_guards_update_primary(): Primary entry guards have changed. New primary guard list is:
  [info] entry_guards_update_primary():   1/3: [bridge] ($0000000000000000000000000000000000000000)
  [info] entry_guards_update_primary():   2/3: [bridge] ($0000000000000000000000000000000000000000)
  [info] entry_guards_update_primary():   3/3: [bridge] ($0000000000000000000000000000000000000000)

When tor starts, it will find the bridge fingerprint by connecting to it and
will then update the primary guard list by calling
entry_guard_learned_bridge_identity() which then goes and update only 1 single
entry resulting in this list:

  [debug] sampled_guards_update_consensus_presence(): Sampled guard [bridge] ($<FINGERPRINT>) is still listed.
  [debug] sampled_guards_update_consensus_presence(): Sampled guard [bridge] ($0000000000000000000000000000000000000000) is still listed.
  [debug] sampled_guards_update_consensus_presence(): Sampled guard [bridge] ($0000000000000000000000000000000000000000) is still listed.

And here lies the problem, now tor is stuck attempting to wait for a valid
descriptor for at least 2 guards where the second one is a bunch of zeroes and
thus tor will never fully bootstraps:

  [info] I learned some more directory information, but not enough to build a
  circuit: We're missing descriptors for 1/2 of our primary entry guards
  (total microdescriptors: 6671/6703). That's ok. We will try to fetch missing
  descriptors soon.

Now, why passing the fingerprint then works? This is because the list of
guards contains 3 times the same bridge but they all have a fingerprint and so
the descriptor can be found and tor can bootstraps.

The solution here is to entirely remove the transport name check in
get_sampled_guard_for_bridge() since the transport_list is empty at that
point. That way, the eligible guard list only gets 1 entry, the bridge, and
can then go on to bootstrap properly.

It is OK to do so since when launching a bridge descriptor fetch, we validate
that the bridge transport name is OK and thus avoid connecting to a bridge
without a ClientTransportPlugin. If we wanted to keep the check in place, we
would need to populate the transport_list much earlier and this would require
a much bigger refactoring.

Fixes #40360

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-04-08 14:08:28 -04:00
..
.dummy Add a .dummy file in the changes directory to stop git from removing it 2015-05-11 11:41:48 -04:00
40241 Fix warnings in current debian-hardened CI. 2021-01-11 14:25:56 -05:00
40241_v2 Delete changes/40241_v2 as it breaks CI. 2021-02-05 19:18:13 +00:00
bug24857 fix changes file 2021-01-21 13:39:40 -05:00
bug30187 Implement WIN32 tor_cond_wait using condition variables #30187 2020-11-01 03:10:25 +00:00
bug32666 Remove unnecessary non-fatal assertion. 2021-01-19 17:08:01 +00:00
bug32880 Use connection_or_change_state() in v3 handshaking state change 2020-11-12 12:06:34 -05:00
bug40015 Avoid asserts with flag 2020-10-27 14:47:42 -07:00
bug40017 Deliberately close OR connections if proxies leave extra data 2020-11-12 11:07:33 -05:00
bug40172 changes file for bug 40172. 2020-11-10 17:29:37 -05:00
bug40177 Fix another duplicate typedef. 2020-11-02 07:15:10 -05:00
bug40179_part1 Handle a change in the implementation of hashlib in Python 3.9 2020-11-05 09:34:36 -05:00
bug40179_part2 Make config/parse_tcp_proxy_line work in the presence of DNS hijacking 2020-11-05 09:47:32 -05:00
bug40187 Fake the current time when we're loading TEST_DESCRIPTORS. 2020-11-12 09:28:27 -05:00
bug40190 Socks5: handle truncated client requests correctly 2020-12-14 10:14:03 -05:00
bug40210 Fix Keccak undefined behavior on exotic platforms. 2020-12-17 13:49:17 +02:00
bug40238 Changes file for #40238. 2021-01-21 23:17:31 +02:00
bug40256_045 Fix documentation formatting for VirtualAddrNetworkIPv6 2021-03-08 11:17:24 -05:00
bug40281 Don't log supported-protover warnings if consensus is older than Tor. 2021-02-08 11:52:53 -05:00
bug40285_045 Don't warn about missing guard state if controller picked first hop 2021-03-08 13:42:43 -05:00
bug40287 relay: No longer test dirport reachability for authorities 2021-02-17 10:28:18 -05:00
bug40298 Make our configure.ac script use the portable = comparison 2021-02-17 12:36:23 -05:00
bug40315 Fix parsing bug in linux get_total_system_memory(). 2021-03-03 14:52:15 -05:00
bug40316 Fix detection of point to insert signatures on a pending consensus. 2021-03-15 08:56:58 -04:00
bug40318 Fix glob processing on BSD systems. #40318 2021-03-26 01:56:07 +00:00
geoip-2021-03-12 Use the right ticket number. 2021-03-12 11:31:36 -05:00
ticket2667 exit: Deny re-entry into the network 2021-01-29 14:28:54 -05:00
ticket18888 Log a warning if Tor was built with any "risky" compile-time options 2020-10-28 11:34:30 -04:00
ticket22473 Remove "GETINFO network-status". 2020-10-28 11:48:23 -04:00
ticket25528 config: Bridge line with a transport must have a ClientTransportPlugin 2020-11-18 11:31:37 -05:00
ticket32178 Revise fix for bug 32178 (spaces at end of log msg). 2020-10-28 09:41:51 -04:00
ticket33624 m4: Change LIBS order of TOR_SEARCH_LIBRARY() 2021-01-13 09:52:10 -05:00
ticket40071 changes: Add file for #40071 2020-11-17 07:58:26 -05:00
ticket40106 config: Remove Bridge <-> ClientTransportPlugin validation 2021-01-20 15:56:19 -05:00
ticket40111 configure: Fix the --enable-static-tor switch 2020-12-08 09:14:49 -05:00
ticket40142 sendme: Turn log warning into debug 2020-11-17 13:23:34 -05:00
ticket40165 Changes file for #40165 (openssl deprecation warnings) 2020-10-28 10:34:22 -04:00
ticket40170 Fix a previously overstrict log message check. 2020-10-28 10:47:39 -04:00
ticket40174 configure: Check STAP_PROBEV macro when building with USDT tracing 2020-11-03 09:05:53 -05:00
ticket40183 port: Don't ignore ports of a different family 2020-11-13 08:38:22 -05:00
ticket40188 Tweak the documentation for approved-routers 2020-12-09 14:08:55 -05:00
ticket40195 config: Really ignore non ORPorts when removing duplicates 2020-11-17 09:40:16 -05:00
ticket40201 relay: Log address suggested by directory authorities 2020-12-21 14:41:52 -05:00
ticket40205 relay: Avoid log reachability test for bandwidth test circuit 2020-12-08 14:51:31 -05:00
ticket40208 relay: Allow RFC1918 addresses for non public relays 2021-02-10 13:24:21 -05:00
ticket40221_045 Remove DirCache=1 from list of supported versions. 2021-02-08 11:40:35 -05:00
ticket40226 relay: Report the entire content of a stats file 2020-12-21 13:18:20 -05:00
ticket40227 build: Add "make lsp" command 2021-01-21 16:06:31 -05:00
ticket40231 relay: Don't BUG() if we can't find authority descriptor 2021-01-14 10:02:03 -05:00
ticket40237 hs-v3: Require reasonably live consensus 2021-01-12 09:46:35 -05:00
ticket40243 Revert "IPv6 sybil: consider addresses in the same /64 to be equal." 2021-01-15 12:57:57 -05:00
ticket40245 log more during consensus voting process 2021-01-21 13:46:56 -05:00
ticket40254 relay: Don't trigger an address discovery without an ORPort 2021-01-27 09:36:17 -05:00
ticket40257 conn: Properly close MetricsPort socket on EOF 2021-02-08 14:26:45 -05:00
ticket40279 relay: Look at the omit IPv6 flag when publishing 2021-02-08 11:51:45 -05:00
ticket40286_minimal Clarify new intended strategy with TROVE-2021-001 2021-03-15 08:53:36 -04:00
ticket40289 config: Do not compare for duplicate ORPorts with different addresses 2021-02-12 13:13:43 -05:00
ticket40295 metrics: Handle the connection finished flushing event 2021-02-17 09:54:05 -05:00
ticket40300 relay: Avoid a directory early fetch 2021-02-23 09:49:45 -05:00
ticket40309 Remove mallinfo() from codebase 2021-02-23 12:16:58 -05:00
ticket40334 hs: Remove hamrless BUG() that can happen 2021-03-10 09:12:29 -05:00
ticket40345 channel: Fix use after free in channel_do_open_actions() 2021-03-23 09:19:41 -04:00
ticket40360 guard: Don't check bridge transport name when selecting eligible guards 2021-04-08 14:08:28 -04:00