aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-09-22srv: Remove spammy debug logDavid Goulet
Fixes #40135 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-09-22Fix warnings when using two unusual options together.Nick Mathewson
The option `--enable-all-bugs-are-fatal` when used with `--disable-module-relay` caused GCC to warn about functions that it thought should be labeled noreturn. I've tried a couple of approaches, but disabling the warning on these functions seems to be the best approach. Fixed #40129; bugfix on 0.4.4.1-alpha.
2020-09-18Renerate src/test/fuzz/include.amNick Mathewson
2020-09-18Build one big .a library full of Tor's implementation.Nick Mathewson
This is experimental and probably will break some platforms
2020-09-18Merge remote-tracking branch 'tor-gitlab/mr/137'Alexander Færøy
2020-09-18Add flag for whether an OR conn "counts" for bootstrap trackingNick Mathewson
We set this flag if we've launched the connection in order to satisfy an origin circuit, or when we decide the connection _would_ satisfy an origin circuit. These are the only or_connections we want to consider for bootstrapping: other or_connections are opened because of client EXTEND requests, and they may succeed or fail because of the clients' confusion or misconfiguration. Closes #25061.
2020-09-18Merge branch 'maint-0.4.3' into maint-0.4.4David Goulet
2020-09-18Merge branch 'maint-0.3.5' into maint-0.4.3David Goulet
2020-09-18Merge branch 'maint-0.4.4'David Goulet
2020-09-17Fix underflow in rend_cache/free_all test.Nick Mathewson
We already fixed these in #40099 and #40125. This patch fixes #40126. Bugfix on 0.2.8.1-alpha.
2020-09-17Merge branch 'maint-0.4.4'Nick Mathewson
2020-09-17Merge branch 'maint-0.4.3' into maint-0.4.4Nick Mathewson
2020-09-17Merge branch 'maint-0.3.5' into maint-0.4.3Nick Mathewson
2020-09-17test: Increment rend cache allocation before freeingDavid Goulet
The rend_cache/entry_free was missing the rend cache allocation increment before freeing the object. Without it, it had an underflow bug: Sep 17 08:40:13.845 [warn] rend_cache_decrement_allocation(): Bug: Underflow in rend_cache_decrement_allocation (on Tor 0.4.5.0-alpha-dev 7eef9ced61e72b1d) Fixes #40125 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-09-17Merge branch 'tor-gitlab/mr/129'David Goulet
2020-09-17Resolve some coverity complaints in test_util_glob().Nick Mathewson
Coverity's first complaint was that we didn't check the return values from chmod. That's easily fixed. Coverity's second complaint was that there were code paths where we pass NULL to chmod. For example, if this line failed, we'd "goto done", and then pass NULL to chmod. tt_ptr_op(dirname, OP_NE, NULL); Closes #40103. Bug not in any released Tor.
2020-09-17Use the correct SIGNED_KEY_TYPE value for signing->link certsNick Mathewson
Our code was using [01] as for the key type of signed->link certs, which was incorrect. The value should be [03], to indicate that the value as the SHA256 of an x.509 cert. Fortunately, nothing cares about this value, so there shouldn't be compatibility issues. Fixes bug 40124; bugfix on 0.2.7.2-alpha.
2020-09-17Merge branch 'tor-gitlab/mr/131'David Goulet
2020-09-17Fix wide linesNick Mathewson
2020-09-17Rename tor_cert_create to tor_cert_create_ed25519Nick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ tor_cert_create tor_cert_create_ed25519 It was generated with --no-verify, so it probably breaks some commit hooks. The commiter should be sure to fix them up in a subsequent commit.
2020-09-15Bump version to 0.4.4.5-dev.Nick Mathewson
2020-09-14Bump version to 0.4.4.5Nick Mathewson
2020-09-14Resolve a compilation warning in test_connection.cNick Mathewson
Instead of casting an enum to a void and back, use a string -- that's better C anyway. Fixes bug 40113; bugfix on 0.2.9.3-alpha.
2020-09-14Update remaining trac.tpo wiki urlsNick Mathewson
2020-09-10Check if glob() is available at build-time.Alexander Færøy
This patch disables the glob() support in the path library if glob() is unavailable at build-time. This currently happens with the Android NDK used for Tor Browser. See: https://bugs.torproject.org/tpo/core/tor/40114
2020-09-08Merge branch 'maint-0.4.4'David Goulet
2020-09-07statistics: Properly count all rendezvous cells (avoid undercounting).George Kadianakis
tl;dr We were not counting cells flying from the client to the service, but we were counting cells flying from the service to the client. When a rendezvous cell arrives from the client to the RP, the RP forwards it to the service. For this to happen, the cell first passes through command_process_relay_cell() which normally does the statistics counting. However because the `rend_circ` circuit was not flagged with `circuit_carries_hs_traffic_stats` in rend_mid_rendezvous(), the cell is not counted there. Then the cell goes to circuit_receive_relay_cell() which has a special code block based on `rend_splice` specifically for rendezvous cells, and the cell gets directly passed to `rend_circ` via a direct call to circuit_receive_relay_cell(). The cell never passes through command_process_relay_cell() ever again and hence is never counted by our rephist module. The fix here is to flag the `rend_circ` circuit with `circuit_carries_hs_traffic_stats` so that the cell is counted as soon as it hits command_process_relay_cell(). Furthermore we avoid double-counting cells since the special code block of circuit_receive_relay_cell() makes us count rendezvous cells only as they enter the RP and not as they exit it. Fixes #40117.
2020-09-03addr: Missing AF family to index conversionDavid Goulet
When accessing the last_resolved_address cache we always need to convert the AF family value to an index value else we are out of bound and thus overflowing if we write to it. This fix is on code that has not been released. GeKo reported the following libasan crash using Tor Browser alpha with tor 0.4.5.0-alpha-dev (3c884bc9e077e997): ==4240==ERROR: AddressSanitizer: global-buffer-overflow on address 0x55888490e388 at pc 0x5588842cc216 bp 0x7ffc8c421b00 sp 0x7ffc8c421af8 READ of size 2 at 0x55888490e388 thread T0 #0 0x5588842cc215 in tor_addr_compare_masked (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x5a6215) #1 0x558884203210 in is_local_to_resolve_addr (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x4dd210) #2 0x558883f7e252 in channel_tls_connect (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x258252) #3 0x558883f87ff7 in channel_connect_for_circuit (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x261ff7) #4 0x558883f8bc90 in circuit_handle_first_hop (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x265c90) #5 0x558883f8c891 in circuit_establish_circuit (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x266891) #6 0x558883fc3bbc in circuit_launch_by_extend_info (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x29dbbc) #7 0x558883fc5900 (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x29f900) #8 0x558883fc6988 in connection_ap_handshake_attach_circuit (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x2a0988) #9 0x558883fd0d3f in connection_ap_attach_pending (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x2aad3f) #10 0x7f4d50110885 (TorBrowser/Tor/libevent-2.1.so.7+0x22885) #11 0x7f4d501110de in event_base_loop (TorBrowser/Tor/libevent-2.1.so.7+0x230de) #12 0x558883f69b3c in do_main_loop (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x243b3c) #13 0x558883f3f70c in tor_run_main (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x21970c) #14 0x558883f3c2f7 in tor_main (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x2162f7) #15 0x558883f3531b in main (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x20f31b) #16 0x7f4d4f76acc9 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26cc9) #17 0x558883f3ba00 (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x215a00) 0x55888490e388 is located 24 bytes to the left of global variable 'state_mgr' defined in 'src/app/config/statefile.c:184:22' (0x55888490e3a0) of size 8 0x55888490e388 is located 32 bytes to the right of global variable 'global_state' defined in 'src/app/config/statefile.c:204:20' (0x55888490e360) of size 8 SUMMARY: AddressSanitizer: global-buffer-overflow (/home/thomas/Arbeit/Tor/tor-browser-build/tor-browser_en-US/Browser/TorBrowser/Tor/tor+0x5a6215) in tor_addr_compare_masked Shadow bytes around the buggy address: 0x0ab190919c20: 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 0x0ab190919c30: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 03 f9 f9 f9 0x0ab190919c40: f9 f9 f9 f9 03 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 0x0ab190919c50: 00 00 00 04 f9 f9 f9 f9 00 00 00 00 00 00 00 04 0x0ab190919c60: f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 =>0x0ab190919c70: f9[f9]f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 0x0ab190919c80: 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 0x0ab190919c90: 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 0x0ab190919ca0: 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 0x0ab190919cb0: 01 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 0x0ab190919cc0: 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==4240==ABORTING Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-09-01conn: Remove assert on new listener connection when retryingDavid Goulet
Opening a new listener connection can fail in many ways like a bind() permission denied on a low port for instance. And thus, we should expect to handle an error when creating a new one instead of assert() on it. To hit the removed assert: ORPort 80 KeepBindCapabilities 0 Start tor. Then edit torrc: ORPort <some-IP>:80 HUP tor and the assert is hit. Fixes #40073 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-08-26Merge remote-tracking branch 'tor-gitlab/mr/133'Alexander Færøy
2020-08-26Merge branch 'tor-gitlab/mr/135'David Goulet
2020-08-25Merge branch 'mr/113'George Kadianakis
2020-08-25Even argument spacing for some functions in feature/client/bridges.cNeel Chauhan
2020-08-25Validate address more carefully when checking self-reachabilityNick Mathewson
Previously, we would treat *any* incoming circuit on a non-local channel as meaning that our ORPort was reachable. With this patch, we make sure that the address that the peer _says_ we have is the same as the one we're trying to advertise right now. Closes 20165. Bugfix on 4f5192b2803c706 in 0.1.0.1-rc, when reachability self-tests were first introduced.
2020-08-25Merge remote-tracking branch 'tor-gitlab/mr/115'George Kadianakis
2020-08-25Merge branch 'maint-0.4.4'David Goulet
2020-08-25Avoid guard-related warning when upgrading from 043 to 044.George Kadianakis
Fixes #40105.
2020-08-25Merge remote-tracking branch 'tor-gitlab/mr/108'George Kadianakis
2020-08-25Merge branch 'maint-0.4.4'George Kadianakis
2020-08-25Merge remote-tracking branch 'tor-gitlab/mr/130' into maint-0.4.4George Kadianakis
2020-08-23Include crypto_rand.h in ed25519_tor.cNeel Chauhan
2020-08-20Merge branch 'maint-0.4.4'George Kadianakis
2020-08-20v3 control: Persist ONION_CLIENT_AUTH_ADD client nameNeel Chauhan
2020-08-19relay: Query our cache when deciding for dummy descriptor fetchDavid Goulet
Instead of looking at the "Address" option alone, instead check if we have an address in our cache (that is discovered by tor). If not, then it tells us that tor does not have an address to work with so we can then ask a directory authority for a suggestion. Related #2178 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-08-19hs: Don't overwrite DoS parameters on circuit with consensus paramsDavid Goulet
Turns out that the HS DoS defenses parameters were overwritten by the consensus parameters everytime a new consensus would arrive. This means that a service operator can still enable the defenses but as soon as the intro point relay would get a new consensus, they would be overwritten. And at this commit, the network is entirely disabling DoS defenses. Fix this by introducing an "explicit" flag that indicate if the ESTABLISH_INTRO cell DoS extension set those parameters or not. If set, avoid using the consenus at once. We are not bumping the protover HSIntro value for this because 0.4.2.x series is EOL in 1 month and thus 0.4.3.x would be the only series with this bug. We are confident that a backport and then upgrade path to the latest 0.4.4.x stable coming up soon is enough to mitigate this problem in the coming months. It avoids the upgrade path on the service side by keeping the requirement for protover HSIntro=5. Fixes #40109 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-08-19Merge branch 'maint-0.4.4'George Kadianakis
2020-08-19Merge branch 'mr/124' into maint-0.4.4George Kadianakis
2020-08-19Parallelize src/test/test into chunks.Nick Mathewson
First, we introduce a flag to teach src/test/test to split its work into chunks. Then we replace our invocation of src/test/test in our "make check" target with a set of 8 scripts that invoke the first 8th of the tests, the second 8th, and so on. This change makes our "make -kj4 check" target in our hardened gitlab build more than twice as fast, since src/test/test was taking the longest to finish. Closes 40098.
2020-08-18Merge branch 'tor-gitlab/mr/126'David Goulet
2020-08-18Merge branch 'maint-0.4.4'David Goulet