Opened 3 years ago

Closed 10 days ago

#16372 closed defect (fixed)

tor uses getaddrinfo even if DisableNetwork is set

Reported by: teor Owned by:
Priority: Low Milestone: Tor: 0.3.4.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-relay documentation easy
Cc: Actual Points:
Parent ID: #16366 Points: 0.1
Reviewer: Sponsor:


If DisableNetwork is set, but tor is passed a textual (?) address in a *Port config line, it uses getaddrinfo to lookup the address. This can access the network and cause config parsing to hang. (See #16366.)

The documentation for DisableNetwork could be clearer about this - that tor *will* make certain network-related calls as part of its config process, even if DisableNetwork is set.

If the config uses names that need to be looked up using the network, this also means the external network needs to be up for config parsing to succeed. (Which seems like an unexpected dependency.)

So DisableNetwork may not be able to be used as described (implied?) - for a controller to setup the config while the network is down, then re-enable tor networking when the network comes up.

Child Tickets

Attachments (2)

0001-DisableNetwork-documentation-improvised.patch (1002 bytes) - added by aruna1234 6 weeks ago.
0002-DisabledNetwork-corrected-to-DisableNetwork.patch (893 bytes) - added by aruna1234 2 weeks ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 3 years ago by arma

See #393 for another ticket that would do a dns resolve on config load, hopefully ignoring the value of DisableNetwork (I say hopefully because I think there's no support for trying to resolve it later, which is what the bug is about).

For other mildly related tickets see also #10566 and #2106.

comment:2 Changed 3 years ago by teor

See also #449 - dns failures prevent legitimate options being set

comment:3 Changed 16 months ago by teor

Milestone: Tor: 0.2.???Tor: 0.3.???

Milestone renamed

comment:4 Changed 15 months ago by nickm

Keywords: tor-03-unspecified-201612 added
Milestone: Tor: 0.3.???Tor: unspecified

Finally admitting that 0.3.??? was a euphemism for Tor: unspecified all along.

comment:5 Changed 10 months ago by nickm

Keywords: tor-03-unspecified-201612 removed

Remove an old triaging keyword.

comment:6 Changed 9 months ago by nickm

Keywords: tor-relay documentation easy added; lorax removed
Severity: Normal

This could be an easy fix, if we say that the right answer is to change the documentation of DisableNetwork.

comment:7 Changed 3 months ago by aruna1234

It would be great if you could also state the file name which requires the change in documentation.

comment:8 Changed 3 months ago by teor

Tor options are documented in the tor man page, which is built from tor/doc/tor.1.txt

comment:9 Changed 6 weeks ago by teor

Milestone: Tor: unspecifiedTor: 0.3.3.x-final
Points: 0.1
Status: newneeds_revision

Thanks for this patch, the name of the option is "DisableNetwork".

Please attach a revised patch containing all the changes.

comment:10 Changed 2 weeks ago by teor

Milestone: Tor: 0.3.3.x-finalTor: 0.3.4.x-final
Status: needs_revisionmerge_ready
Version: Tor: unspecified

Thanks, we'll squash and merge both patches attached to this ticket.

comment:11 Changed 10 days ago by nickm

Resolution: fixed
Status: merge_readyclosed

Lightly tweaked (to mention what kinds of network activity we mean), squashed, and merged!

Note: See TracTickets for help on using tickets.