Commit Graph

8512 Commits

Author SHA1 Message Date
teor
f2f7491cd9
Merge branch 'ticket32629_029' into ticket32629_035
Merge re-enable chutney from ticket32629_029 with
stem from maint-0.3.5.
2019-11-28 12:21:08 +10:00
teor
99b5f1b261
Revert "Travis: Disable all but one macOS build"
This reverts commit 511aeba8ee.
2019-11-28 12:10:10 +10:00
teor
26071aa3be
Merge branch 'maint-0.4.0' into maint-0.4.1 2019-11-25 12:37:07 +10:00
teor
055f5d4d1b
Merge branch 'maint-0.3.5' into maint-0.4.0 2019-11-25 12:36:59 +10:00
teor
c17ab20ac0
Merge remote-tracking branch 'tor-github/pr/1441' into maint-0.4.0 2019-11-25 12:36:41 +10:00
teor
ed6f2f61a2
Merge remote-tracking branch 'tor-github/pr/1396' into maint-0.4.0 2019-11-25 12:35:58 +10:00
teor
501b5174d8
Merge remote-tracking branch 'tor-github/pr/1464' into maint-0.3.5 2019-11-25 12:35:11 +10:00
teor
400cee261e
Merge remote-tracking branch 'tor-github/pr/1422' into maint-0.3.5 2019-11-25 12:34:29 +10:00
teor
54c01119ed
Merge remote-tracking branch 'tor-github/pr/1405' into maint-0.3.5 2019-11-25 12:33:55 +10:00
teor
83424cb62f
Merge remote-tracking branch 'tor-github/pr/1395' into maint-0.3.5 2019-11-25 12:33:14 +10:00
teor
f9812ee5f7
Merge remote-tracking branch 'tor-github/pr/1394' into maint-0.3.5 2019-11-25 12:29:43 +10:00
Nick Mathewson
29eb7b07ef Merge branch 'maint-0.4.0' into maint-0.4.1 2019-11-11 10:14:04 -05:00
Nick Mathewson
329aa1c48e Merge branch 'maint-0.3.5' into maint-0.4.0 2019-11-11 10:14:03 -05:00
Nick Mathewson
7beaaed245 Merge branch 'maint-0.2.9' into maint-0.3.5 2019-11-11 10:14:03 -05:00
teor
7043be968a
Merge branch 'maint-0.4.0' into maint-0.4.1 2019-11-11 14:19:47 +10:00
teor
29940511e3
Merge branch 'maint-0.3.5' into maint-0.4.0 2019-11-11 14:19:39 +10:00
teor
2abff832dd
Appveyor: Install OpenSSL to resolve a header/library mismatch
Install the mingw OpenSSL package in Appveyor. This makes sure that
the OpenSSL headers and libraries match in Tor's Appveyor builds.

(This bug was triggered by an Appveyor image update.)

Fixes bug 32449; bugfix on 0.3.5.6-rc.
2019-11-11 13:19:15 +10:00
Karsten Loesing
853b6ad095 Update geoip and geoip6 to the November 6 2019 database. 2019-11-09 10:10:19 +01:00
Nick Mathewson
4d70e725d1 Do not try to shut down the event loop when it is not initialized.
Doing so caused us to crash in some unusual circumstances, such as
using --verify-config to verify a configuration that failed during
the options_act() stage.

Fixes bug 32407; bugfix on 0.3.3.1-alpha.
2019-11-06 11:33:23 -05:00
teor
de6ceb0bee
Merge branch 'maint-0.4.0' into maint-0.4.1 2019-11-06 11:19:46 +10:00
teor
03e77ef036
Merge branch 'maint-0.3.5' into maint-0.4.0 2019-11-06 11:19:38 +10:00
teor
1bde356bf6
Merge branch 'maint-0.2.9' into maint-0.3.5 2019-11-06 11:19:30 +10:00
teor
4f9a003392
Merge remote-tracking branch 'tor-github/pr/1374' into maint-0.4.1 2019-11-06 11:19:13 +10:00
teor
4abfcb7997
Merge remote-tracking branch 'tor-github/pr/1354' into maint-0.3.5 2019-11-06 11:18:09 +10:00
teor
0e2834a371
Merge remote-tracking branch 'tor-github/pr/1348' into maint-0.3.5 2019-11-06 11:17:43 +10:00
teor
d2e4262ebc
Merge remote-tracking branch 'tor-github/pr/1340' into maint-0.3.5 2019-11-06 11:17:01 +10:00
teor
6bfdd09679
Merge remote-tracking branch 'tor-github/pr/1343' into maint-0.3.5 2019-11-06 11:16:09 +10:00
teor
0650bf3695
Merge remote-tracking branch 'tor-github/pr/1342' into maint-0.2.9 2019-11-06 11:15:45 +10:00
teor
c06d540ff9
Merge remote-tracking branch 'tor-github/pr/1330' into maint-0.2.9 2019-11-06 11:14:53 +10:00
teor
63aff4a43e
Merge branch 'maint-0.4.0' into maint-0.4.1 2019-10-29 08:26:48 +10:00
teor
54e2d0dc2d
Merge branch 'maint-0.3.5' into maint-0.4.0 2019-10-29 08:26:40 +10:00
teor
15d67842f9
Merge branch 'maint-0.2.9' into maint-0.3.5 2019-10-29 08:26:32 +10:00
teor
752c35ca96
Merge remote-tracking branch 'tor-github/pr/1460' into maint-0.2.9 2019-10-29 08:23:35 +10:00
teor
63581d55a6
Merge branch 'maint-0.4.0' into maint-0.4.1 2019-10-25 10:56:06 +10:00
teor
e56e7e865e
Merge branch 'maint-0.3.5' into maint-0.4.0 2019-10-25 10:55:58 +10:00
teor
e03db9934a
Merge branch 'maint-0.2.9' into maint-0.3.5 2019-10-25 10:55:51 +10:00
teor
93be7275ec
changes: file for 31919's bionic Travis image change 2019-10-25 09:53:11 +10: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
14b197a148
Travis: Use macOS 10.14 with Xcode 11.2
Closes ticket 32241.
2019-10-24 11:44:43 +10:00
teor
4342486649
Travis: Use zstd in our Travis Linux builds
Recent Ubuntu versions have zstd >= 1.1, which is an optional tor build
dependency.

Closes ticket 32242.
2019-10-24 09:26:54 +10:00
teor
8bc65cda44
Merge branch 'pr1450_squashed' into maint-0.4.1 2019-10-23 09:58:22 +10:00
Nick Mathewson
f3c0a0b9fe
Authorities reject relays running unsupported Tor release series.
Our minimum version is now 0.2.9.5-alpha.  Series 0.3.0, 0.3.1,
0.3.2, 0.3.3, and 0.3.4 are now rejected.

Also, extract this version-checking code into a new function, so we
can test it.

Closes ticket 31549.

Also reject 0.3.5.0 through 0.3.5.6-rc as unstable.
2019-10-23 09:57:51 +10:00
teor
4a5c909ce5
Merge branch 'maint-0.4.0' into maint-0.4.1 2019-10-23 08:47:15 +10:00
teor
57acdaa3f1
Merge branch 'maint-0.3.5' into maint-0.4.0 2019-10-23 08:47:08 +10:00
teor
641f130447
Merge remote-tracking branch 'tor-github/pr/1361' into maint-0.4.0 2019-10-23 08:35:17 +10: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
8682442c76
Merge remote-tracking branch 'tor-github/pr/1351' into maint-0.2.9 2019-10-23 08:32:22 +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
teor
7660a7cf7d
Merge remote-tracking branch 'tor-github/pr/1178' into maint-0.2.9 2019-10-23 08:20:45 +10:00
Nick Mathewson
3c071f3002 Merge remote-tracking branch 'tor-github/pr/1330' into maint-0.4.1 2019-10-22 12:54:37 -04:00
Nick Mathewson
d08d29f15f Merge remote-tracking branch 'tor-github/pr/1341' into maint-0.4.1 2019-10-22 12:53:06 -04:00
Nick Mathewson
b588b60876 Merge remote-tracking branch 'tor-github/pr/1343' into maint-0.4.1 2019-10-22 12:51:27 -04:00
Nick Mathewson
9769df89fe Merge remote-tracking branch 'tor-github/pr/1303' into maint-0.4.1 2019-10-22 12:15:06 -04:00
Nick Mathewson
c1bf4260b6 Merge remote-tracking branch 'tor-github/pr/1302' into maint-0.4.1 2019-10-22 12:13:47 -04:00
Nick Mathewson
d4dde249a0 Merge remote-tracking branch 'tor-github/pr/1346' into maint-0.4.1 2019-10-22 12:11:50 -04:00
Nick Mathewson
4013e50cb7 Merge branch 'maint-0.3.5' into maint-0.4.0 2019-10-22 12:10:30 -04:00
Nick Mathewson
6965798a16 Merge branch 'maint-0.4.0' into maint-0.4.1 2019-10-22 12:10:30 -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
Nick Mathewson
4c8af10f0e Merge remote-tracking branch 'tor-github/pr/1385' into maint-0.4.1 2019-10-22 12:08:46 -04:00
teor
2318bb237f
Merge branch 'maint-0.4.0' into maint-0.4.1 2019-10-22 20:48:13 +10:00
teor
9bb0ca122f
Merge branch 'maint-0.3.5' into maint-0.4.0 2019-10-22 20:48:05 +10: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
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
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
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
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
9915b8f0bc 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 16:39:05 +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
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
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
984a28f3e5 hs-v3: Make service pick the exact amount of intro points
When encoding introduction points, we were not checking if that intro points
had an established circuit.

When botting up, the service will pick, by default, 3 + 2 intro points and the
first 3 that establish, we use them and upload the descriptor.

However, the intro point is removed from the service descriptor list only when
the circuit has opened and we see that we have already enough intro points, it
is then removed.

But it is possible that the service establishes 3 intro points successfully
before the other(s) have even opened yet.

This lead to the service encoding extra intro points in the descriptor even
though the circuit is not opened or might never establish (#31561).

Fixes #31548

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-07 10:20:09 -04:00
teor
ff304f3be7
tls: Log TLS read buffer length bugs once
Rather than filling the logs with similar warnings.

Fixes bug 31939; bugfix on 0.3.0.4-rc.
2019-10-04 12:33:34 +10:00
Nick Mathewson
a74c180691 Merge branch 'maint-0.3.5' into maint-0.4.0 2019-10-02 08:01:34 -04:00
Nick Mathewson
4dcbbe4166 Merge branch 'maint-0.4.0' into maint-0.4.1 2019-10-02 08:01:34 -04:00
Nick Mathewson
7b9cb4c47b Merge branch 'maint-0.2.9' into maint-0.3.5 2019-10-02 08:01:33 -04:00
Karsten Loesing
90de776ea9 Update geoip and geoip6 to the October 1 2019 database. 2019-10-02 11:11:27 +02:00
Nick Mathewson
2b825a1a2e Fix a crash bug in max_u16_in_sl()
The documentation for this function says that the smartlist can
contain NULLs, but the code only handled NULLs if they were at the
start of the list.

We didn't notice this for a long time, because when Tor is run
normally, the sequence of msg_id_t is densely packed, and so this
list (mapping msg_id_t to channel_id_t) contains no NULL elements.
We could only run into this bug:
  * when Tor was running in embedded mode, and starting more than once.
  * when Tor ran first with more pubsub messages enabled, and then
    later with fewer.
  * When the second run (the one with fewer enabled pubsub messages)
    had at least some messages enabled, and those messages were not
    the ones with numerically highest msg_id_t values.

Fixes bug 31898; bugfix on 47de9c7b0a
in 0.4.1.1-alpha.
2019-10-01 13:01:20 -04:00
teor
e5dda7f664
Merge branch 'bug31859_040' into bug31859_041
Merge TOR_TEST_RNG_SEED in maint-0.4.1 into the coverage line
from bug31859_040.
2019-10-01 23:50:24 +10:00
teor
07db4141ab
Merge branch 'bug31859_035' into bug31859_040 2019-10-01 23:46:28 +10:00
teor
f368f5bc37
Merge branch 'bug31859_029' into bug31859_035
While merging:
* leave out some redundant jobs and build matrix entries
2019-10-01 17:31:55 +10:00
teor
1e0e23c1e4
Travis: Add a macOS chutney job, but don't wait for it to finish
Since Travis macOS has IPv6 support (and Travis Linux does not), chutney
will now run its IPv6 networks as part of Travis CI.

But since chutney is slow, don't wait for the macOS chutney to finish.
(Travis have fixed the duplicate notification bug in fast_finish. So we
can use fast_finish and allow_failure to finish early. Unfortunately,
allow_failure also means we ignore failures in macOS chutney.)

Also make sure that we have:
* a compile on each platform, with each compiler,
* a check on each platform, and
* a check on each compiler.

Finally, sort builds: allow fail last, macOS first, slowest first.

Closes ticket 30860.
Closes ticket 31859 for 0.2.9.
2019-09-30 23:58:38 +10:00
teor
4e4297830e
Travis: Remove a redundant clang Linux job
Part of 31859.
2019-09-30 23:58:24 +10:00
teor
b186418792
Appveyor: Avoid spurious errors in Appveyor CI builds
When Appveyor fails before the install step, some of the finish step's
functions were not defined.

Fixes bug 31884; bugfix on 0.3.4.2-alpha.
2019-09-30 15:14:21 +10:00
teor
2420c8c936 test: Avoid a map_anon_nofork test failure on SunOS
This test failure happened due to a signed/unsigned integer
comparison.

This bug occurred on SunOS, it may also occur on other systems that
use signed char as the default. (And cast 1-byte integer constants
to an unsigned integer.)

Fixes bug 31897; bugfix on 0.4.1.1-alpha.
2019-09-30 14:54:56 +10:00
teor
d1eab05834
lock: Avoid some undefined behaviour when freeing mutexes.
Fixes bug 31736; bugfix on 0.0.7.
2019-09-26 12:37:25 +10:00
teor
c9c046c365
changes: file for 31614 2019-09-26 12:22:21 +10:00
Nick Mathewson
246fdd8742 Merge branch 'ticket31372_035' into ticket31372_040 2019-09-24 08:02:44 -04:00
Nick Mathewson
da5c8277ea Merge branch 'ticket31372_029' into ticket31372_035 2019-09-24 08:01:43 -04:00
teor
0614f83905
changes: use correct bugfix release, and reword changes file for 31408 2019-09-24 11:06:20 +10:00
Nick Mathewson
49a11f8a8a Try using make -k in the Appveyor configuration
Frequently, when a patch fails, it has failures in several files.
Using the "-k" flag will let us learn all the compilation errors,
not just the first one that the compiler hits.

Based on a patch by rl1987.

Closes ticket 31372.
2019-09-23 15:08:34 -04:00
Nick Mathewson
6ed3d8dbd1 Try using make -k in Travis configuration
Frequently, when a patch fails, it has failures in several files.
Using the "-k" flag will let us learn all the compilation errors,
not just the first one that the compiler hits.

Based on a patch by rl1987.
2019-09-23 15:05:08 -04:00
Daniel Pinto
15490816da
Fix bug when %including folder with comment only files. #31408
When processing a %included folder, a bug caused the pointer to
the last element of the options list to be set to NULL when
processing a file with only comments or whitepace. This could
cause options from other files on the same folder to be
discarded depending on the lines after the affected %include.
2019-09-23 10:39:08 +10:00