Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#2367 closed defect (duplicate)

Torrc parser crashing for long ExitPolicy lists

Reported by: hellais Owned by:
Priority: Medium Milestone:
Component: Core Tor/Tor Version: Tor: 0.2.1.26
Severity: Keywords: tor-relay
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

While running tor as a relay and having a long (300 lines) list of ExitPolicy directives in the torrc file I get the following error:
Jan 09 19:12:55.541 [warn] router_dump_router_to_string(): Bug: descriptor policy_write_item ran out of room!
Jan 09 19:12:55.541 [warn] router_rebuild_descriptor(): Bug: Couldn't generate router descriptor.

And Tor will not start.

Steps to reproduce:

  • Add 200-300 lines of ExitPolicy directives

for example:

ExitPolicy reject 217.169.96.0/20:*, reject 217.169.112.0/20:*, reject 217.170.224.0/20:*
ExitPolicy reject 217.171.32.0/20:*, reject 217.171.160.0/20:*, reject 217.172.0.0/20:*
ExitPolicy reject 217.172.192.0/19:*, reject 217.174.112.0/20:*, reject 217.174.128.0/20:*
...

  • Start tor
  • cat /var/log/tor/log

Jan 09 19:12:00.938 [warn] router_dump_router_to_string(): Bug: descriptor policy_write_item ran out of room!
Jan 09 19:12:00.938 [warn] router_rebuild_descriptor(): Bug: Couldn't generate router descriptor.

Child Tickets

Change History (4)

comment:1 Changed 7 years ago by hellais

UPDATE:
I now noticed that this is issue is also partly discussed in this ticket:
https://trac.torproject.org/projects/tor/ticket/993

And I have encountered this issue while trying to block traffic to specific countries.
In case you need it to reproduce the issue you can find my script here:
https://github.com/hellais/blockfinder/blob/master/torexit.py

comment:2 Changed 7 years ago by Sebastian

Resolution: duplicate
Status: newclosed

Reproducing this is no problem; it is a known design limitation. I'm going to close this bug and add a reference to bug #993. I'm afraid that a fix will take a long time, because a lot of design is involved.

comment:3 Changed 5 years ago by nickm

Keywords: tor-relay added

comment:4 Changed 5 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.