Opened 5 years ago

Closed 5 years ago

#13295 closed defect (fixed)

tor-resolve asserts due to missing crypto initialization.

Reported by: yawning Owned by:
Priority: Medium Milestone: Tor: 0.2.5.x-final
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Keywords: tor-resolve
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

From IRC, trivial to reproduce.

ypres :: Development/tor/build ‹master*› % ./src/tools/tor-resolve www.google.com localhost:9050
Sep 29 15:32:50.517 [err] tor_assertion_failed_(): Bug: ../src/ext/csiphash.c:156: siphash24g: Assertion the_siphash_key_is_set failed; aborting.
Sep 29 15:32:50.517 [err] Bug: Assertion the_siphash_key_is_set failed in siphash24g at ../src/ext/csiphash.c:156. Stack trace:
Sep 29 15:32:50.517 [err] Bug:     ./src/tools/tor-resolve(log_backtrace+0x41) [0x7f173d0e1fe1]
Sep 29 15:32:50.517 [err] Bug:     ./src/tools/tor-resolve(tor_assertion_failed_+0x8c) [0x7f173d0d619c]
Sep 29 15:32:50.517 [err] Bug:     ./src/tools/tor-resolve(siphash24g+0x5f) [0x7f173d0e1def]
Sep 29 15:32:50.517 [err] Bug:     ./src/tools/tor-resolve(+0x235cc) [0x7f173d0df5cc]
Sep 29 15:32:50.518 [err] Bug:     ./src/tools/tor-resolve(sandbox_getaddrinfo+0x75) [0x7f173d0e0e85]
Sep 29 15:32:50.518 [err] Bug:     ./src/tools/tor-resolve(tor_addr_lookup+0x119) [0x7f173d0c88e9]
Sep 29 15:32:50.518 [err] Bug:     ./src/tools/tor-resolve(tor_lookup_hostname+0x25) [0x7f173d0cd7e5]
Sep 29 15:32:50.518 [err] Bug:     ./src/tools/tor-resolve(addr_port_lookup+0xb2) [0x7f173d0c9b52]
Sep 29 15:32:50.518 [err] Bug:     ./src/tools/tor-resolve(main+0x182) [0x7f173d0c7012]
Sep 29 15:32:50.518 [err] Bug:     /usr/lib/libc.so.6(__libc_start_main+0xf0) [0x7f173b943040]
Sep 29 15:32:50.518 [err] Bug:     ./src/tools/tor-resolve(+0xbb52) [0x7f173d0c7b52]
[1]    19923 abort (core dumped)  ./src/tools/tor-resolve www.google.com localhost:9050

I reproduced it with master, but any version that uses the siphash backed HT implementation will have this problem. Calling crypto_global_init() and linking the appropriate libraries fixes the problem, naturally.

Child Tickets

Change History (3)

comment:1 Changed 5 years ago by yawning

Status: newneeds_review

The trivial fix: https://github.com/Yawning/tor/tree/bug13295

Sort of sad at all the additional library code that is being pulled in, but so it goes.

comment:2 Changed 5 years ago by nickm

I've got another fix in "bug13295_v2_025" which I don't believe will require us to link anything extra. Thoughts?

(Note that I think this only happens when you're on Linux, and when you have libseccomp2 present, and when you specify the hostname of your tor.)

comment:3 Changed 5 years ago by nickm

Milestone: Tor: 0.2.5.x-final
Resolution: fixed
Status: needs_reviewclosed

Yawning says it looks okay. Merged to maint-0.2.5 and forward.

Note: See TracTickets for help on using tickets.