Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#3742 closed defect (fixed)

auto ports are always chosen as port 94

Reported by: Sebastian Owned by:
Priority: Medium Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

With the proposal 171 implementation, we also added a bug inside retry_listener_ports(): When we call tor_addr_to_sockaddr(), the second argument is a uint16_t, but we stick an int into it. When this int has the value of CFG_AUTO_PORT, it gets truncated to 94 - and port 94 can typically not be opened without root.

Child Tickets

Change History (6)

comment:1 Changed 8 years ago by Sebastian

Status: newneeds_review

Proposed fix in bug3742 in my repo. CAUTION: I am not sure if the change to make port_cfg_t non-const is safe with the smartlist thing. I didn't want to just change the argument for the tor_addr_to_sockaddr() call, because connection_create_listener() also takes port as an argument (it doesn't look at port->port, but there's nothing saying that it might not start doing that some day).

comment:2 Changed 8 years ago by Sebastian

ok, there's still a problem here:

[{{
$ src/or/tor socksport auto
...

[notice] Opening Socks listener on 127.0.0.1:0
[notice] Socks listener listening on port 58416.

...

[notice] Opening Socks listener on 127.0.0.1:0
[notice] Socks listener listening on port 58417.
[notice] Closing no-longer-configured Socks listener on 127.0.0.1:58416

}}}

comment:3 Changed 8 years ago by Sebastian

Looks like the word of caution was right on. bug3742_v2 seems to fix the problem.

comment:4 Changed 8 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

merged; thanks!

comment:5 Changed 7 years ago by nickm

Keywords: tor-client added

comment:6 Changed 7 years ago by nickm

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