Opened 2 years ago

Last modified 2 years ago

#22641 new defect

If you setconf socksport=1000, it returns 553 error but then it sets it anyway, and getconf socksport still returns 9050 even though that's closed

Reported by: arma Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: 032-unreached
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Run your Tor not as root, then connect to your control port and do setconf socksport=1000. Tor will reply with

553 Unable to set option: Failed to bind one of the listener ports.

and it will log

Jun 17 15:48:09.939 [notice] Opening Socks listener on 127.0.0.1:1000
Jun 17 15:48:09.939 [warn] Could not bind to 127.0.0.1:1000: Permission denied
Jun 17 15:48:09.939 [notice] Closing no-longer-configured Socks listener on 127.0.0.1:9050
Jun 17 15:48:09.939 [warn] Controller gave us config lines that didn't validate: Failed to bind one of the listener ports.

So it closed my socksport 9050, and then it was unhappy with the 1000.

Soon, I get another log line:

Jun 17 15:48:33.592 [notice] Opening Socks listener on 127.0.0.1:1000
Jun 17 15:48:33.592 [warn] Could not bind to 127.0.0.1:1000: Permission denied
Jun 17 15:48:33.592 [notice] Closing no-longer-configured Socks listener on 127.0.0.1:9050

Looks like Tor tries periodically to open it, in hopes that it'll work this time.

Bug one is that Tor shouldn't reply to the setconf with an error but then secretly honor it anyway.

And woah, check this out:

getconf socksport
250 SocksPort=9050

So bug number two is that it looks like Tor has been unsynchronized about what its SocksPort actually is.

Child Tickets

Change History (2)

comment:1 Changed 2 years ago by arma

When you start your Tor with socksport 1000, it gives you

Jun 17 15:55:04.903 [notice] Opening Socks listener on 127.0.0.1:1000
Jun 17 15:55:04.903 [warn] Could not bind to 127.0.0.1:1000: Permission denied
Jun 17 15:55:04.904 [warn] Failed to parse/validate config: Failed to bind one of the listener ports.
Jun 17 15:55:04.904 [err] Reading config failed--see warnings above.

I.e. it refuses to start.

So maybe the fix here is that we should actually back out the setconf attempt? Rather than saying we backed it out but then not actually doing so?

comment:2 Changed 2 years ago by nickm

Keywords: 032-unreached added
Milestone: Tor: 0.3.2.x-finalTor: unspecified

Mark a large number of tickets that I do not think we will do for 0.3.2.

Note: See TracTickets for help on using tickets.