Commit Graph

8685 Commits

Author SHA1 Message Date
teor c8aa3cc17d Merge remote-tracking branch 'tor-github/pr/1466' into maint-0.4.2 2019-10-25 10:38:01 +10:00
teor acd27f4b41 Merge remote-tracking branch 'tor-github/pr/1464' into maint-0.4.2 2019-10-25 09:41:48 +10:00
David Goulet 09468cc58b dir: Look if circuit is closed in connection_dir_is_anonymous()
Before inspecting the p_chan, we must check if the circuit is marked for close
because if it is the case, the channels are nullified from the circuit.

Several valid cases can mark the circuit for close of the directory
connection.

Fixes #31958

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-24 11:08:25 -04:00
David Goulet ed57a04a65 hs-v3: Remove a BUG() caused by an acceptable race
hs_client_purge_state() and hs_cache_clean_as_client() can remove a descriptor
from the client cache with a NEWNYM or simply when the descriptor expires.

Which means that for an INTRO circuit being established during that time, once
it opens, we lookup the descriptor to get the IP object but hey surprised, no
more descriptor.

The approach here is minimalist that is accept the race and close the circuit
since we can not continue. Before that, the circuit would stay opened and the
client wait the SockTimeout.

Fixers #28970.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-24 08:50:01 -04:00
teor c77162e4e9 Merge remote-tracking branch 'tor-github/pr/1360' into maint-0.3.5 2019-10-23 08:32:52 +10:00
teor 27965f1ef2 Merge remote-tracking branch 'tor-github/pr/1284' into maint-0.3.5 2019-10-23 08:30:48 +10:00
teor 003be727c4 Merge remote-tracking branch 'tor-github/pr/1256' into maint-0.3.5 2019-10-23 08:28:03 +10:00
Roger Dingledine 4233fb7014 clarify in man page: we count by powers of two
Make clear in the man page, in both the bandwidth section and the
accountingmax section, that Tor counts in powers of two, not
powers of ten: 1 GByte is 1024*1024*1024 bytes, not one billion
bytes.

Resolves ticket 32106.
2019-10-23 07:50:20 +10:00
Nick Mathewson 2ed194c9a9 Merge remote-tracking branch 'tor-github/pr/1441' into maint-0.4.2 2019-10-22 14:46:10 -04:00
Nick Mathewson 21c3488af7 Merge remote-tracking branch 'tor-github/pr/1376' into maint-0.3.5 2019-10-22 12:10:08 -04:00
teor bed4390133 Merge remote-tracking branch 'origin/maint-0.3.5' into maint-0.3.5 2019-10-22 20:47:44 +10:00
teor 8f84999f58 Merge branch 'ticket32177_041' into ticket32177_042
Merge RUST_VERSION from maint-0.4.2 into disabled macOS rust build
from ticket32177_041.
2019-10-22 19:44:58 +10:00
teor 86b1714731 Merge branch 'ticket32177_040' into ticket32177_041 2019-10-22 19:43:38 +10:00
teor 868bcc24e5 Merge branch 'ticket32177_035' into ticket32177_040 2019-10-22 19:43:33 +10:00
teor 8e0190d837 Merge branch 'maint-0.3.5' into ticket32177_035 2019-10-22 19:43:18 +10:00
teor 92ad87b808 Merge branch 'ticket32177_029' into ticket32177_035
Stem from maint-0.3.5, disabled macOS chutney from ticket32177_029.
2019-10-22 19:42:23 +10:00
teor 511aeba8ee Travis: Disable all but one macOS build
We need to mitigate slow scheduling of Travis macOS jobs.

Closes ticket 32177.
2019-10-22 19:35:43 +10:00
Nick Mathewson 7a35c8d8be Merge branch 'maint-0.4.1' into maint-0.4.2 2019-10-21 18:44:44 -04:00
Nick Mathewson 53aa159632 Merge branch 'maint-0.4.0' into maint-0.4.1 2019-10-21 18:44:44 -04:00
Nick Mathewson 89ead08eef Merge branch 'maint-0.3.5' into maint-0.4.0 2019-10-21 18:44:44 -04:00
Roger Dingledine a7ccd9a997 respect accountingmax during soft hibernation
Relays now respect their AccountingMax bandwidth again. When relays
entered "soft" hibernation (which typically starts when we've hit
90% of our AccountingMax), we had stopped checking whether we should
enter hard hibernation. Soft hibernation refuses new connections and
new circuits, but the existing circuits can continue, meaning that
relays could have exceeded their configured AccountingMax.

This commit rolls back some of the cpu-saving fixes, where we tried
to avoid calling so many of our events while we're off the network.

That's because PERIODIC_EVENT_FLAG_NEED_NET checks net_is_disabled(),
which returns true even if we're only in soft hibernation.

Fixes bug 32108; bugfix on 0.4.0.1-alpha.
2019-10-21 04:14:42 -04:00
teor 04e9e74f1d Merge remote-tracking branch 'tor-github/pr/1422' into maint-0.4.2 2019-10-21 13:07:39 +10:00
teor 5c8ecf364a Merge remote-tracking branch 'tor-github/pr/1354' into maint-0.4.2 2019-10-21 09:44:42 +10:00
teor f420b60c19 Appveyor: Use Windows Server 2019
Instead of Windows Server 2016.

Closes ticket 32086.
2019-10-20 22:04:08 +10:00
teor cf2b00d3f5 test/rebind: Make control formatting and log parsing more robust
* actually sleep when tor has not logged anything
* log at debug level when waiting for tor to log something
* backslash-replace bad UTF-8 characters in logs
* format control messages as ASCII: tor does not accept UTF-8 control commands

Fixes bug 31837; bugfix on 0.3.5.1-alpha.
2019-10-20 20:09:35 +10:00
Nick Mathewson f0f3f3338e Merge remote-tracking branch 'tor-github/pr/1427' into maint-0.4.2 2019-10-18 12:42:49 -04:00
Nick Mathewson 0994050c4a Merge remote-tracking branch 'tor-github/pr/1426' into maint-0.4.2 2019-10-18 12:32:29 -04:00
Nick Mathewson 57c4af16f0 Merge remote-tracking branch 'tor-github/pr/1396' into maint-0.4.2 2019-10-18 12:27:39 -04:00
Nick Mathewson fbd2fef220 Merge branch 'maint-0.4.2' of git-rw.torproject.org:/tor into maint-0.4.2 2019-10-18 12:25:55 -04:00
teor b3fc3b609b changes: file for 32124. 2019-10-18 17:26:09 +10:00
teor f73c8bd786 Merge remote-tracking branch 'tor-github/pr/1407' into maint-0.4.2 2019-10-18 12:05:07 +10:00
Alexander Færøy 389b37246e Remove overly strict assertions in transports.c.
This patch removes an overly strict tor_assert() and an ignorable BUG()
expression. Both of these would trigger if a PT was unable to configure
itself during startup. The easy way to trigger this is to configure an
obfs4 bridge where you make the obfs4 process try to bind on a port
number under 1024.

See: https://bugs.torproject.org/31091
2019-10-17 21:33:54 +02:00
Alexander Færøy 85b4a5c276 Handle errors from execve() in the Unix process backend more gracefully.
This patch removes a call to tor_assert_unreached() after execve()
failed. This assertion leads to the child process emitting a stack trace
on its standard output, which makes the error harder for the user to
demystify, since they think it is an internal error in Tor instead of
"just" being a "no such file or directory" error.

The process will now instead output "Error from child process: X" where
X is the stringified version of the errno value.

See: https://bugs.torproject.org/31810
2019-10-17 20:52:22 +02:00
David Goulet 4a8d491322 mainloop: Disable periodic events before a destroy
When tearing down all periodic events during shutdown, disable them first so
their enable flag is updated.

This allows the tor_api.h to relaunch tor properly after a clean shutdown.

Fixes #32058

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-17 10:11:32 -04:00
teor e483257e1b Merge branch 'maint-0.3.5' into maint-0.4.0 2019-10-17 14:51:58 +10:00
teor 92c4dc9b14 Merge remote-tracking branch 'tor-github/pr/1373' into maint-0.4.2 2019-10-17 14:51:30 +10:00
teor 13daf339a9 Merge remote-tracking branch 'tor-github/pr/1372' into maint-0.4.1 2019-10-17 14:51:02 +10:00
teor 702aa8f775 Merge remote-tracking branch 'tor-github/pr/1370' into maint-0.3.5 2019-10-17 14:50:28 +10:00
teor c660f47960 Merge remote-tracking branch 'tor-github/pr/1369' into maint-0.2.9 2019-10-17 14:49:52 +10:00
David Goulet 09e6c0f7c7 hs-v3: Fix possible memory leak in error code path
Found by coverity CID 1454769.

There were a second possible leak that is also fixed in this commit.

Fixes #32063

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-15 08:54:11 -04:00
Nick Mathewson eebd2d44a1 Merge remote-tracking branch 'tor-github/pr/1393' into maint-0.4.2 2019-10-14 15:55:13 -04:00
Nick Mathewson 2e5724d153 Merge branch 'ticket31682_042_01_squashed' 2019-10-11 10:21:58 -04:00
David Goulet b356b3907a hs-v3: Fix implicit ssize_t to size_t conversion
Found by Coverity.

Fixes #31682

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-11 10:20:36 -04:00
Nick Mathewson 0d82a8be77 Merge remote-tracking branch 'tor-github/pr/1394' 2019-10-09 16:44:12 -04:00
Nick Mathewson ab064cf762 Merge remote-tracking branch 'tor-github/pr/1399' 2019-10-09 16:37:47 -04:00
Nick Mathewson 755f001600 Merge remote-tracking branch 'tor-github/pr/1401' 2019-10-09 16:29:46 -04:00
Nick Mathewson 99809834a7 Merge branch 'bug30344_squashed_035' 2019-10-09 16:26:31 -04:00
George Kadianakis 841cff6e4f Stop libevent from reading data from closed connections.
Code adapted from Rob's proposed patch in #30344.

Also add a comment in connection_mark_for_close_internal_() on why we should
not be adding extra code there without a very good reason.
2019-10-09 16:24:49 -04:00
David Goulet f50de3a918 hs-v3: Do not remove intro point if circuit exists
When considering introduction point of a service's descriptor, do not remove
an intro point that has an established or pending circuit.

Fixes #31652

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-08 17:02:47 -04:00
David Goulet 1f60337da4 Merge branch 'tor-github/pr/1381' 2019-10-08 14:49:39 -04:00