]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
6 years agoAdd changes file
rl1987 [Fri, 12 Apr 2019 19:43:49 +0000 (22:43 +0300)] 
Add changes file

6 years agoFix remaining shellcheck warnings in fuzz_multi.sh
rl1987 [Fri, 12 Apr 2019 19:41:39 +0000 (22:41 +0300)] 
Fix remaining shellcheck warnings in fuzz_multi.sh

6 years agoAdd shebang line to fuzz_multi.sh (fixes SC2148)
rl1987 [Fri, 12 Apr 2019 19:38:06 +0000 (22:38 +0300)] 
Add shebang line to fuzz_multi.sh (fixes SC2148)

6 years agoMerge branch 'tor-github/pr/908'
George Kadianakis [Fri, 12 Apr 2019 10:47:08 +0000 (13:47 +0300)] 
Merge branch 'tor-github/pr/908'

6 years agoMerge branch 'tor-github/pr/754'
George Kadianakis [Fri, 12 Apr 2019 10:45:53 +0000 (13:45 +0300)] 
Merge branch 'tor-github/pr/754'

6 years agocrypt_ops: Stop using a separate buffer in ed25519_signature_from_base64()
teor [Fri, 12 Apr 2019 03:00:02 +0000 (13:00 +1000)] 
crypt_ops: Stop using a separate buffer in ed25519_signature_from_base64()

Part of 29960.

6 years agoforward-port the 0.4.0.4-rc changelog
Nick Mathewson [Thu, 11 Apr 2019 21:06:19 +0000 (17:06 -0400)] 
forward-port the 0.4.0.4-rc changelog

6 years agoMerge branch 'maint-0.4.0'
Nick Mathewson [Thu, 11 Apr 2019 21:05:45 +0000 (17:05 -0400)] 
Merge branch 'maint-0.4.0'

6 years agobump to 0.4.0.4-rc-dev
Nick Mathewson [Thu, 11 Apr 2019 21:05:38 +0000 (17:05 -0400)] 
bump to 0.4.0.4-rc-dev

6 years agoMerge remote-tracking branch 'tor-github/pr/913'
Nick Mathewson [Thu, 11 Apr 2019 18:30:05 +0000 (14:30 -0400)] 
Merge remote-tracking branch 'tor-github/pr/913'

6 years agoMerge remote-tracking branch 'tor-github/pr/887'
Nick Mathewson [Thu, 11 Apr 2019 18:29:16 +0000 (14:29 -0400)] 
Merge remote-tracking branch 'tor-github/pr/887'

6 years agoMerge remote-tracking branch 'tor-github/pr/741'
Nick Mathewson [Thu, 11 Apr 2019 18:27:06 +0000 (14:27 -0400)] 
Merge remote-tracking branch 'tor-github/pr/741'

6 years agoMerge branch 'maint-0.4.0'
Nick Mathewson [Wed, 10 Apr 2019 15:52:12 +0000 (11:52 -0400)] 
Merge branch 'maint-0.4.0'

6 years agoBump version to 0.4.0.4-rc
Nick Mathewson [Wed, 10 Apr 2019 15:51:49 +0000 (11:51 -0400)] 
Bump version to 0.4.0.4-rc

6 years agoMerge branch 'maint-0.4.0'
Nick Mathewson [Wed, 10 Apr 2019 15:31:44 +0000 (11:31 -0400)] 
Merge branch 'maint-0.4.0'

6 years agoMerge remote-tracking branch 'tor-github/pr/926' into maint-0.4.0
Nick Mathewson [Wed, 10 Apr 2019 15:31:33 +0000 (11:31 -0400)] 
Merge remote-tracking branch 'tor-github/pr/926' into maint-0.4.0

6 years agoAdd changes file for #30040.
George Kadianakis [Tue, 9 Apr 2019 14:30:14 +0000 (17:30 +0300)] 
Add changes file for #30040.

6 years agoPrevent double free on huge files with 32 bit.
Tobias Stoeckmann [Sun, 31 Mar 2019 10:27:55 +0000 (12:27 +0200)] 
Prevent double free on huge files with 32 bit.

The function compat_getdelim_ is used for tor_getline if tor is compiled
on a system that lacks getline and getdelim. These systems should be
very rare, considering that getdelim is POSIX.

If this system is further a 32 bit architecture, it is possible to
trigger a double free with huge files.

If bufsiz has been already increased to 2 GB, the next chunk would
be 4 GB in size, which wraps around to 0 due to 32 bit limitations.

A realloc(*buf, 0) could be imagined as "free(*buf); return malloc(0);"
which therefore could return NULL. The code in question considers
that an error, but will keep the value of *buf pointing to already
freed memory.

The caller of tor_getline() would free the pointer again, therefore
leading to a double free.

This code can only be triggered in dirserv_read_measured_bandwidths
with a huge measured bandwith list file on a system that actually
allows to reach 2 GB of space through realloc.

It is not possible to trigger this on Linux with glibc or other major
*BSD systems even on unit tests, because these systems cannot reach
so much memory due to memory fragmentation.

This patch is effectively based on the penetration test report of
cure53 for curl available at https://cure53.de/pentest-report_curl.pdf
and explained under section "CRL-01-007 Double-free in aprintf() via
unsafe size_t multiplication (Medium)".

6 years agopractracker: accept 4 extra lines due to 30041
teor [Wed, 10 Apr 2019 08:29:11 +0000 (18:29 +1000)] 
practracker: accept 4 extra lines due to 30041

6 years agoMerge branch 'maint-0.4.0'
teor [Wed, 10 Apr 2019 08:27:11 +0000 (18:27 +1000)] 
Merge branch 'maint-0.4.0'

6 years agoMerge remote-tracking branch 'tor-github/pr/920' into maint-0.4.0
teor [Wed, 10 Apr 2019 08:26:49 +0000 (18:26 +1000)] 
Merge remote-tracking branch 'tor-github/pr/920' into maint-0.4.0

6 years agoMerge branch 'maint-0.4.0'
Nick Mathewson [Tue, 9 Apr 2019 17:51:44 +0000 (13:51 -0400)] 
Merge branch 'maint-0.4.0'

6 years agoMerge branch 'bug29922_035' into maint-0.4.0
Nick Mathewson [Tue, 9 Apr 2019 17:49:58 +0000 (13:49 -0400)] 
Merge branch 'bug29922_035' into maint-0.4.0

6 years agoActually I believe this should be an EINVAL.
Nick Mathewson [Tue, 9 Apr 2019 17:49:10 +0000 (13:49 -0400)] 
Actually I believe this should be an EINVAL.

6 years agoChanges file for bug30041
Nick Mathewson [Tue, 9 Apr 2019 16:03:22 +0000 (12:03 -0400)] 
Changes file for bug30041

6 years agoCheck return value of buf_move_to_buf for error.
Tobias Stoeckmann [Sun, 31 Mar 2019 15:33:11 +0000 (17:33 +0200)] 
Check return value of buf_move_to_buf for error.

If the concatenation of connection buffer and the buffer of linked
connection exceeds INT_MAX bytes, then buf_move_to_buf returns -1 as an
error value.

This value is currently casted to size_t (variable n_read) and will
erroneously lead to an increasement of variable "max_to_read".

This in turn can be used to call connection_buf_read_from_socket to
store more data inside the buffer than expected and clogging the
connection buffer.

If the linked connection buffer was able to overflow INT_MAX, the call
of buf_move_to_buf would have previously internally triggered an integer
overflow, corrupting the state of the connection buffer.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
6 years agoProtect buffers against INT_MAX datalen overflows.
Tobias Stoeckmann [Sun, 31 Mar 2019 15:32:41 +0000 (17:32 +0200)] 
Protect buffers against INT_MAX datalen overflows.

Many buffer functions have a hard limit of INT_MAX for datalen, but
this limitation is not enforced in all functions:

- buf_move_all may exceed that limit with too many chunks
- buf_move_to_buf exceeds that limit with invalid buf_flushlen argument
- buf_new_with_data may exceed that limit (unit tests only)

This patch adds some annotations in some buf_pos_t functions to
guarantee that no out of boundary access could occur even if another
function lacks safe guards against datalen overflows.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
6 years agoMerge branch 'maint-0.4.0'
George Kadianakis [Tue, 9 Apr 2019 09:25:18 +0000 (12:25 +0300)] 
Merge branch 'maint-0.4.0'

6 years agoMerge branch 'tor-github/pr/915' into maint-0.4.0
George Kadianakis [Tue, 9 Apr 2019 09:24:52 +0000 (12:24 +0300)] 
Merge branch 'tor-github/pr/915' into maint-0.4.0

6 years agoMerge branch 'maint-0.4.0'
teor [Tue, 9 Apr 2019 01:36:59 +0000 (11:36 +1000)] 
Merge branch 'maint-0.4.0'

6 years agoMerge remote-tracking branch 'tor-github/pr/866'
teor [Tue, 9 Apr 2019 01:36:38 +0000 (11:36 +1000)] 
Merge remote-tracking branch 'tor-github/pr/866'

6 years agoMerge remote-tracking branch 'tor-github/pr/862'
teor [Tue, 9 Apr 2019 01:36:12 +0000 (11:36 +1000)] 
Merge remote-tracking branch 'tor-github/pr/862'

6 years agoMerge remote-tracking branch 'tor-github/pr/892' into maint-0.4.0
teor [Tue, 9 Apr 2019 01:35:41 +0000 (11:35 +1000)] 
Merge remote-tracking branch 'tor-github/pr/892' into maint-0.4.0

6 years agomanpage: Clarify that Tor does stream isolation between *Port listeners by default
rl1987 [Mon, 25 Mar 2019 13:40:46 +0000 (15:40 +0200)] 
manpage: Clarify that Tor does stream isolation between *Port listeners by default

cherry-pick of tor-github/pr/841 to maint-0.4.0.

6 years agoDetect and suppress an additional gmtime() warning in test_util.c
Nick Mathewson [Mon, 8 Apr 2019 21:02:14 +0000 (17:02 -0400)] 
Detect and suppress an additional gmtime() warning in test_util.c

Fixes bug 29922; bugfix on 0.2.9.3-alpha when we tried to capture
all these warnings.  No need to backport any farther than 0.3.5,
though -- these warnings don't cause test failures before then.

This one was tricky to find because apparently it only happened on
_some_ windows builds.

6 years agoFix SC2006 in minimize.sh
rl1987 [Mon, 8 Apr 2019 08:16:45 +0000 (11:16 +0300)] 
Fix SC2006 in minimize.sh

6 years agopractracker: accept 6 extra lines in tortls_nss.c:tor_tls_context_new()
teor [Sat, 6 Apr 2019 02:19:47 +0000 (12:19 +1000)] 
practracker: accept 6 extra lines in tortls_nss.c:tor_tls_context_new()

These lines were added to fix bug 29241.

6 years agoMerge branch 'maint-0.4.0'
teor [Sat, 6 Apr 2019 02:23:25 +0000 (12:23 +1000)] 
Merge branch 'maint-0.4.0'

6 years agoMerge remote-tracking branch 'tor-github/pr/911' into maint-0.4.0
teor [Sat, 6 Apr 2019 02:15:41 +0000 (12:15 +1000)] 
Merge remote-tracking branch 'tor-github/pr/911' into maint-0.4.0

6 years agochanges: Ticket 29241 is actually a bug on NSS in 0.3.5.1-alpha
teor [Sat, 6 Apr 2019 01:07:20 +0000 (11:07 +1000)] 
changes: Ticket 29241 is actually a bug on NSS in 0.3.5.1-alpha

6 years agoNSS: disable TLS1.2 SHA-384 ciphersuites.
Nick Mathewson [Fri, 29 Mar 2019 17:38:48 +0000 (13:38 -0400)] 
NSS: disable TLS1.2 SHA-384 ciphersuites.

In current NSS versions, these ciphersuites don't work with
SSL_ExportKeyingMaterial(), which was causing relays to fail when
they tried to negotiate the v3 link protocol authentication.

Fixes bug 29241; bugfix on 0.4.0.1-alpha.

6 years agoNSS: Log an error message when SSL_ExportKeyingMaterial() fails
Nick Mathewson [Fri, 29 Mar 2019 17:38:14 +0000 (13:38 -0400)] 
NSS: Log an error message when SSL_ExportKeyingMaterial() fails

Diagnostic for 29241.

6 years agoMerge branch 'maint-0.4.0'
teor [Fri, 5 Apr 2019 23:33:38 +0000 (09:33 +1000)] 
Merge branch 'maint-0.4.0'

6 years agoMerge branch 'maint-0.3.5' into maint-0.4.0
teor [Fri, 5 Apr 2019 23:33:28 +0000 (09:33 +1000)] 
Merge branch 'maint-0.3.5' into maint-0.4.0

6 years agoMerge branch 'maint-0.3.4' into maint-0.3.5
teor [Fri, 5 Apr 2019 23:33:20 +0000 (09:33 +1000)] 
Merge branch 'maint-0.3.4' into maint-0.3.5

6 years agoMerge branch 'maint-0.2.9' into maint-0.3.4
teor [Fri, 5 Apr 2019 23:33:11 +0000 (09:33 +1000)] 
Merge branch 'maint-0.2.9' into maint-0.3.4

6 years agoMerge remote-tracking branch 'tor-github/pr/898' into maint-0.3.5
teor [Fri, 5 Apr 2019 23:32:53 +0000 (09:32 +1000)] 
Merge remote-tracking branch 'tor-github/pr/898' into maint-0.3.5

6 years agoMerge remote-tracking branch 'tor-github/pr/903' into maint-0.3.5
teor [Fri, 5 Apr 2019 23:31:52 +0000 (09:31 +1000)] 
Merge remote-tracking branch 'tor-github/pr/903' into maint-0.3.5

6 years agoMerge remote-tracking branch 'tor-github/pr/879' into maint-0.3.5
teor [Fri, 5 Apr 2019 23:30:52 +0000 (09:30 +1000)] 
Merge remote-tracking branch 'tor-github/pr/879' into maint-0.3.5

6 years agoMerge remote-tracking branch 'tor-github/pr/878' into maint-0.3.4
teor [Fri, 5 Apr 2019 23:30:04 +0000 (09:30 +1000)] 
Merge remote-tracking branch 'tor-github/pr/878' into maint-0.3.4

6 years agoMerge remote-tracking branch 'tor-github/pr/902' into maint-0.2.9
teor [Fri, 5 Apr 2019 23:28:58 +0000 (09:28 +1000)] 
Merge remote-tracking branch 'tor-github/pr/902' into maint-0.2.9

6 years agoMerge remote-tracking branch 'tor-github/pr/877' into maint-0.2.9
teor [Fri, 5 Apr 2019 23:28:13 +0000 (09:28 +1000)] 
Merge remote-tracking branch 'tor-github/pr/877' into maint-0.2.9

6 years agopractracker: allow config.c to be a touch larger.
Nick Mathewson [Fri, 5 Apr 2019 13:59:45 +0000 (09:59 -0400)] 
practracker: allow config.c to be a touch larger.

6 years agoMerge branch 'tor-github/pr/907'
George Kadianakis [Fri, 5 Apr 2019 13:45:55 +0000 (16:45 +0300)] 
Merge branch 'tor-github/pr/907'

6 years agoMerge branch 'tor-github/pr/906' into maint-0.4.0
George Kadianakis [Fri, 5 Apr 2019 13:44:59 +0000 (16:44 +0300)] 
Merge branch 'tor-github/pr/906' into maint-0.4.0

6 years agoMerge branch 'maint-0.4.0'
George Kadianakis [Fri, 5 Apr 2019 11:57:06 +0000 (14:57 +0300)] 
Merge branch 'maint-0.4.0'

6 years agoMerge branch 'tor-github/pr/901' into maint-0.4.0
George Kadianakis [Fri, 5 Apr 2019 11:56:52 +0000 (14:56 +0300)] 
Merge branch 'tor-github/pr/901' into maint-0.4.0

6 years agoMerge branch 'maint-0.4.0'
George Kadianakis [Fri, 5 Apr 2019 11:55:22 +0000 (14:55 +0300)] 
Merge branch 'maint-0.4.0'

6 years agoMerge branch 'tor-github/pr/879' into maint-0.4.0
George Kadianakis [Fri, 5 Apr 2019 11:55:09 +0000 (14:55 +0300)] 
Merge branch 'tor-github/pr/879' into maint-0.4.0

6 years agoMerge branch 'maint-0.4.0'
George Kadianakis [Fri, 5 Apr 2019 11:53:39 +0000 (14:53 +0300)] 
Merge branch 'maint-0.4.0'

6 years agoMerge branch 'tor-github/pr/902' into maint-0.4.0
George Kadianakis [Fri, 5 Apr 2019 11:53:33 +0000 (14:53 +0300)] 
Merge branch 'tor-github/pr/902' into maint-0.4.0

6 years agoMerge branch 'tor-github/pr/761'
George Kadianakis [Fri, 5 Apr 2019 11:52:36 +0000 (14:52 +0300)] 
Merge branch 'tor-github/pr/761'

6 years agoMerge branch 'maint-0.4.0'
George Kadianakis [Fri, 5 Apr 2019 11:51:33 +0000 (14:51 +0300)] 
Merge branch 'maint-0.4.0'

6 years agoMerge branch 'tor-github/pr/800' into maint-0.4.0
George Kadianakis [Fri, 5 Apr 2019 11:51:21 +0000 (14:51 +0300)] 
Merge branch 'tor-github/pr/800' into maint-0.4.0

6 years agochanges: file for 29660
teor [Fri, 5 Apr 2019 05:16:49 +0000 (15:16 +1000)] 
changes: file for 29660

6 years agobinascii: Fix the base64_encode_nopad() buffer length requirement
teor [Fri, 5 Apr 2019 05:10:36 +0000 (15:10 +1000)] 
binascii: Fix the base64_encode_nopad() buffer length requirement

Comment-only change.

Part of 29660.

6 years agocrypto_format: Stop adding padding in ed25519_signature_from_base64()
teor [Fri, 5 Apr 2019 05:10:00 +0000 (15:10 +1000)] 
crypto_format: Stop adding padding in ed25519_signature_from_base64()

base64_decode() does not require padding.

Part of 29660.

6 years agocrypto_format: Remove the return value from ed25519_signature_to_base64()
teor [Fri, 5 Apr 2019 05:08:54 +0000 (15:08 +1000)] 
crypto_format: Remove the return value from ed25519_signature_to_base64()

Also remove all checks for the return value, which were redundant anyway,
because the function never failed.

Part of 29660.

6 years agocrypto_format: Remove the return value from curve25519_public_to_base64()
teor [Fri, 5 Apr 2019 05:06:30 +0000 (15:06 +1000)] 
crypto_format: Remove the return value from curve25519_public_to_base64()

And fix the documentation on the function: it does produce trailing
"="s as padding.

Also remove all checks for the return value, which were redundant anyway,
because the function never failed.

Part of 29660.

6 years agocrypto_format: Remove the return values from digest256_to_base64()
teor [Fri, 5 Apr 2019 05:02:43 +0000 (15:02 +1000)] 
crypto_format: Remove the return values from digest256_to_base64()

... and ed25519_public_to_base64(). Also remove all checks for the return
values, which were redundant anyway, because the functions never failed.

Part of 29960.

6 years agocrypto_format: Remove unused return value from digest_to_base64()
teor [Fri, 5 Apr 2019 04:58:20 +0000 (14:58 +1000)] 
crypto_format: Remove unused return value from digest_to_base64()

Part of 29660.

6 years agocrypto_format: Remove outdated comments
teor [Fri, 5 Apr 2019 03:58:23 +0000 (13:58 +1000)] 
crypto_format: Remove outdated comments

(These functions look pretty unified to me.)

Part of 29660.

6 years agoMerge branch 'bug29036-29962-034' into bug29036-29962-035
teor [Fri, 5 Apr 2019 02:58:32 +0000 (12:58 +1000)] 
Merge branch 'bug29036-29962-034' into bug29036-29962-035

6 years agoMerge branch 'bug29036-029' into bug29036-29962-034
teor [Fri, 5 Apr 2019 02:58:16 +0000 (12:58 +1000)] 
Merge branch 'bug29036-029' into bug29036-29962-034

6 years agoMakefile: actually, don't delete the gcno files
teor [Fri, 5 Apr 2019 02:56:29 +0000 (12:56 +1000)] 
Makefile: actually, don't delete the gcno files

We need to keep the gcno files, because they are created at compile time.

6 years agoMerge branch 'bug29500_040_monoinit_revert' into bug29500_master_monoinit
teor [Fri, 5 Apr 2019 02:24:20 +0000 (12:24 +1000)] 
Merge branch 'bug29500_040_monoinit_revert' into bug29500_master_monoinit

Apply data structure changes between 0.4.0 and 0.4.1.

6 years agoRevert "test/circuitpadding: Delete circuitpadding_circuitsetup_machine()"
teor [Fri, 5 Apr 2019 02:22:18 +0000 (12:22 +1000)] 
Revert "test/circuitpadding: Delete circuitpadding_circuitsetup_machine()"

This reverts commit 387d9448de4c5044800706b4ed21b48b4426cb7e.

6 years agocircuitpadding: comment fixes
teor [Wed, 3 Apr 2019 03:40:06 +0000 (13:40 +1000)] 
circuitpadding: comment fixes

6 years agotest/circuitpadding: Delete circuitpadding_circuitsetup_machine()
teor [Tue, 2 Apr 2019 09:56:38 +0000 (19:56 +1000)] 
test/circuitpadding: Delete circuitpadding_circuitsetup_machine()

This test was disabled in 0.4.0 and later, but the fix in #29298 was only
merged to 0.4.1. So this test will never be re-enabled in 0.4.0.

Part of 29500.

6 years agoBug #29500: Fix monotime mocking in circpad unittests.
Mike Perry [Fri, 5 Apr 2019 00:21:07 +0000 (00:21 +0000)] 
Bug #29500: Fix monotime mocking in circpad unittests.

Our monotime mocking forces us to call monotime_init() *before* we set the
mocked time value. monotime_init() thus stores the first ratchet value at
whatever the platform is at, and then we set fake mocked time to some later
value.

If monotime_init() gets a value from the host that is greater than what we
choose to mock time at for our unittests, all subsequent monotime_abosolute()
calls return zero, which breaks all unittests that depend on time moving
forward by updating mocked monotime values.

So, we need to adjust our mocked time to take the weird monotime_init() time
into account, when we set fake time.

6 years agoChanges file for bug 29500.
Mike Perry [Mon, 4 Mar 2019 21:54:56 +0000 (21:54 +0000)] 
Changes file for bug 29500.

6 years agoBug 29500: Start monotime at 1000 nsec.
Mike Perry [Mon, 4 Mar 2019 21:54:19 +0000 (21:54 +0000)] 
Bug 29500: Start monotime at 1000 nsec.

Hopefully this will stop monotime_absolute_usec() from returning 0 on some
platforms in the tests.

6 years agoBug 29500: Attempt to fix the tokens test.
Mike Perry [Wed, 27 Feb 2019 00:27:22 +0000 (00:27 +0000)] 
Bug 29500: Attempt to fix the tokens test.

Cancel the padding timer by changing order of sent vs recv (sent cancels).

6 years agoMerge remote-tracking branch 'tor-github/pr/752'
Nick Mathewson [Fri, 5 Apr 2019 00:39:36 +0000 (20:39 -0400)] 
Merge remote-tracking branch 'tor-github/pr/752'

6 years agoMerge branch 'maint-0.4.0'
Nick Mathewson [Fri, 5 Apr 2019 00:27:04 +0000 (20:27 -0400)] 
Merge branch 'maint-0.4.0'

6 years agoMerge branch 'bug29959_040_squashed' into maint-0.4.0
Nick Mathewson [Fri, 5 Apr 2019 00:26:47 +0000 (20:26 -0400)] 
Merge branch 'bug29959_040_squashed' into maint-0.4.0

6 years agobwauth: Actually include the bandwidth-file-digest in authority votes
teor [Sat, 30 Mar 2019 02:09:47 +0000 (12:09 +1000)] 
bwauth: Actually include the bandwidth-file-digest in authority votes

Fixes bug 29959; bugfix on 0.4.0.2-alpha.

6 years agoUse an enum for inherit_result_out.
Nick Mathewson [Wed, 3 Apr 2019 14:57:06 +0000 (10:57 -0400)] 
Use an enum for inherit_result_out.

6 years agoSyntax fix in test.
Nick Mathewson [Wed, 6 Mar 2019 17:09:46 +0000 (12:09 -0500)] 
Syntax fix in test.

6 years agorename inherit values to avoid conflict with system defines
Nick Mathewson [Wed, 6 Mar 2019 17:08:25 +0000 (12:08 -0500)] 
rename inherit values to avoid conflict with system defines

6 years agofast_rng: if noinherit has failed, then check getpid() for bad forks
Nick Mathewson [Wed, 6 Mar 2019 16:03:42 +0000 (11:03 -0500)] 
fast_rng: if noinherit has failed, then check getpid() for bad forks

getpid() can be really expensive sometimes, and it can fail to
detect some kind of fork+prng mistakes, so we need to avoid it if
it's safe to do so.

This patch might slow down fast_prng a lot on any old operating
system that lacks a way to prevent ram from being inherited, AND
requires a syscall for any getpid() calls.  But it should make sure
that we either crash or continue safely on incorrect fork+prng usage
elsewhere in the future.

6 years agomap_anon: define a macro if it is possible for noinherit to fail.
Nick Mathewson [Wed, 6 Mar 2019 16:03:26 +0000 (11:03 -0500)] 
map_anon: define a macro if it is possible for noinherit to fail.

6 years agoMake map_anon expose the result of a noinherit attempt
Nick Mathewson [Wed, 6 Mar 2019 15:35:02 +0000 (10:35 -0500)] 
Make map_anon expose the result of a noinherit attempt

Previously we did this for tests only, but it's valuable for getting
proper fork behavior in rand_fast.

6 years agoDrop thread-local fast_rng on fork.
Nick Mathewson [Wed, 6 Mar 2019 14:59:10 +0000 (09:59 -0500)] 
Drop thread-local fast_rng on fork.

This will cause the child process to construct a new one in a nice
safe way.

Closes ticket 29668; bug not in any released Tor.

6 years agoImplement an DormantCanceledByStartup option
Nick Mathewson [Sun, 17 Mar 2019 17:48:00 +0000 (13:48 -0400)] 
Implement an DormantCanceledByStartup option

Closes ticket 29357, and comes with appropriate notions of caution.

6 years agoMerge branch 'bug30021_029' into bug30021_035
Nick Mathewson [Thu, 4 Apr 2019 15:26:33 +0000 (11:26 -0400)] 
Merge branch 'bug30021_029' into bug30021_035

6 years agoDo not cache bogus results from classifying client ciphers
Nick Mathewson [Thu, 4 Apr 2019 15:24:55 +0000 (11:24 -0400)] 
Do not cache bogus results from classifying client ciphers

When classifying a client's selection of TLS ciphers, if the client
ciphers are not yet available, do not cache the result. Previously,
we had cached the unavailability of the cipher list and never looked
again, which in turn led us to assume that the client only supported
the ancient V1 link protocol.  This, in turn, was causing Stem
integration tests to stall in some cases.  Fixes bug 30021; bugfix
on 0.2.4.8-alpha.

6 years agoMerge branch 'bug30011_035' into bug30011_040
teor [Thu, 4 Apr 2019 03:23:26 +0000 (13:23 +1000)] 
Merge branch 'bug30011_035' into bug30011_040

Merge bug30011 new package timelimit with 0.4.0 new package shellcheck.
Move shellcheck into the correct category.

6 years agoTravis: Terminate test-stem if it takes more than 9.5 minutes to run
teor [Thu, 4 Apr 2019 03:02:13 +0000 (13:02 +1000)] 
Travis: Terminate test-stem if it takes more than 9.5 minutes to run

(Travis terminates the job after 10 minutes of no output.)

Diagnostic for 29437.

Fixes bug 30011; bugfix on 0.3.5.4-alpha.

6 years agoImprove logging for 28614.
Nick Mathewson [Wed, 3 Apr 2019 18:30:56 +0000 (14:30 -0400)] 
Improve logging for 28614.

When we fixed 28614, our answer was "if we failed to load the
consensus on windows and it had a CRLF, retry it."  But we logged
the failure at "warn", and we only logged the retry at "info".

Now we log the retry at "notice", with more useful information.

Fixes bug 30004.