Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#5723 closed defect (fixed)

ADDRMAP reversed IP bug

Reported by: mickeyc Owned by: nickm
Priority: High Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version: Tor: 0.2.3.14-alpha
Severity: Keywords: tor-client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description (last modified by rransom)

In the following control port debug log you'll see I look up the IP address of "grepular.com" three times in a row. Look how the octets of the IP address in the ADDRMAP responses are reversed in the second and third responses:

mike@alfa:~$ telnet localhost 9051
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
AUTHENTICATE XXXXX
250 OK
SETEVENTS addrmap
250 OK
RESOLVE grepular.com
250 OK
650 ADDRMAP grepular.com 178.79.145.246 "2012-05-01 01:21:07" EXPIRES="2012-05-01 00:21:07"
RESOLVE grepular.com
650 ADDRMAP grepular.com 246.145.79.178 "2012-05-01 01:21:07" EXPIRES="2012-05-01 00:21:07"
250 OK
RESOLVE grepular.com
650 ADDRMAP grepular.com 246.145.79.178 "2012-05-01 01:21:07" EXPIRES="2012-05-01 00:21:07"
250 OK

If I disconnect and reconnect, they're reversed from the very first response. If I restart Tor and try again, then the first response is correct, but the subsequent responses are all reversed again. This happens for any domain I test. The "tor-resolve" command doesn't display this problem. I'm running version "0.2.3.14-alpha"

Child Tickets

Change History (8)

comment:1 Changed 7 years ago by arma

Component: TorctlTor Client
Owner: aagbsn deleted
Status: newassigned

comment:2 Changed 7 years ago by rransom

Description: modified (diff)

comment:3 Changed 7 years ago by nickm

Owner: set to nickm

Looks like a missing ntohl in tell_controller_about_resolved_result.

comment:4 Changed 7 years ago by nickm

Milestone: Tor: 0.2.3.x-final
Status: assignedneeds_review

See possible fix in branch bug5723 in my public repository.

We should audit the rest of 22f723e4 for similar issues too.

comment:5 Changed 7 years ago by arma

Status: needs_reviewneeds_information

Merged bug5723.

I looked at the other use of tor_dup_ip() in 22f723e4 and it looked ok.

Leaving open for Nick to close when he's satisfied with the 'we should audit' side.

comment:6 Changed 7 years ago by nickm

Resolution: fixed
Status: needs_informationclosed

Didn't find any more; closing.

comment:7 Changed 7 years ago by nickm

Keywords: tor-client added

comment:8 Changed 7 years ago by nickm

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