[tor-bugs] #25928 [Core Tor/Tor]: Single DA in sandbox vs. PDS_ALLOW_SELF flag

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed May 16 15:01:36 UTC 2018


#25928: Single DA in sandbox vs. PDS_ALLOW_SELF flag
---------------------------------------+----------------------------------
 Reporter:  somlo                      |          Owner:  (none)
     Type:  defect                     |         Status:  needs_revision
 Priority:  Medium                     |      Milestone:  Tor: unspecified
Component:  Core Tor/Tor               |        Version:
 Severity:  Normal                     |     Resolution:
 Keywords:  tor-dirauth, test-network  |  Actual Points:
Parent ID:                             |         Points:
 Reviewer:                             |        Sponsor:
---------------------------------------+----------------------------------

Comment (by somlo):

 OK, how about this, then:

 {{{
 diff --git a/src/or/routerlist.c b/src/or/routerlist.c
 index 7603eb3ec..705e76120 100644
 --- a/src/or/routerlist.c
 +++ b/src/or/routerlist.c
 @@ -1786,6 +1786,9 @@ router_pick_dirserver_generic(smartlist_t
 *sourcelist,
    const routerstatus_t *choice;
    int busy = 0;

 +  if (smartlist_len(sourcelist) == 1)
 +    flags |= PDS_ALLOW_SELF;
 +
    choice = router_pick_trusteddirserver_impl(sourcelist, type, flags,
 &busy);
    if (choice || !(flags & PDS_RETRY_IF_NO_SERVERS))
      return choice;
 }}}

 Both router_pick_trusteddirserver() and router_pick_fallback_dirserver()
 rely on router_pick_dirserver_generic(), which, in turn, uses
 router_pick_trusteddirserver_impl().

 The latter contains the following relevant code:
 {{{
 ...
   const int requireother = ! (flags & PDS_ALLOW_SELF);
 ...
     SMARTLIST_FOREACH_BEGIN(sourcelist, const dir_server_t *, d)
     {
 ...
       if (requireother && me && router_digest_is_me(d->digest))
         continue;
 ...
 }}}
 so it appears all of the points made above are being addressed. The
 alternative would be to move the check directly into
 router_pick_trusteddirserver_impl() and eliminate the PS_ALLOW_SELF flag
 altogether, although from my standpoint that'd be a lot more invasive...

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/25928#comment:6>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list