Yesterday I ran an exit node called 'testnoderh' on my Tor instance and then sent a HTTP request through the same tor instance for 'www.google.com.testnoderh.exit'.
Tor didn't like that one bit. It built dozens of circuits very quickly and got nowhere with the request.
'google.com' was a for-instance. Since I've supplied a full log and torrc for the actual failure I should be clear that the test requests were to www.cs.indiana.edu, which was permitted by the node's exit policy.
I chose this approach because adding ourselves to the routerlist seemed to be something we don't want to do, so we don't choose ourselves for circuits. If some exit is specifically requested however, we can still look it up this way.
Need to change build_state_get_exit_router(). The changes is safe but still it's a slighty late for such conditions, ri returned by build_state_get_exit_router() treats like element of global routerlist.
Most safe to change circuit_is_acceptable() and circuit_stream_is_being_handled() and then look at missed anything else.
which does the same I think. One odd problem I encountered was that, although it fixed the circuit-building DOS, it resulted in a circuit being chosen with the wrong exit. Tor had tried to build a four-hop circuit with my Tor instance as the exit but the patch resulted in it using a three-hop circuit exiting somewhere else.I believe this is what yetonetime is alluding to. At least connection_ap_can_use_exit() relies on the presence of the exit in the routerlist with:
It looks to me like supporting the scenario in the bug is a bit of a losing battle. Tor should probably fail gracefully I think and we don't have a patch for that yet.
So, a bit of new info. We closed #641 (moved) because using .exit notation with your own exit works after you have seen your own descriptor in the consensus and added it to the routerlist. So this bug is only about the time between startup and becoming a part of the consensus for the first time.
What we should do here is treat the request like it requested an unknown relay, and fail quickly.
When I looked into the history, I noticed that for both router_get_by_nickname() and router_get_by_digest() we once had the ability to return our own routerinfo, independent of whether it had gotten into the consensus or not. This was introduced in 8efb2a957. In 9c67ae34f106, however, the ability to return your own routerinfo was removed from router_get_by_digest().
nickm and arma should look into which behaviour we actually want. Being inconsistent clearly causes problems here.
Are you reading posts before, or why am I writes that at all?
8efb2a957 is 2005 year. You can't return anything than routerlist's element by router_get_by_*, else it produces unknown edge cases that can happen with exist or a some new funcs or code.
The name of r14281(r14297) is "kludge". if router_get_by_nickname() has been worked as planned by design without non smartlist's elemens then #641 (moved) was never happened at all.