Commit Graph

6811 Commits

Author SHA1 Message Date
Nick Mathewson
950606dcc9 Merge branch 'maint-0.3.2' into maint-0.3.3 2018-03-13 10:58:03 -04:00
Nick Mathewson
38b7885c90 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-03-13 10:58:03 -04:00
Nick Mathewson
0e7f15fdb6 Merge branch 'maint-0.2.9' into maint-0.3.1 2018-03-13 10:58:02 -04:00
Nick Mathewson
67a313f0ec Merge branch 'maint-0.2.5' into maint-0.2.9 2018-03-13 10:58:02 -04:00
Karsten Loesing
3418a3a7f0 Update geoip and geoip6 to the March 8 2018 database. 2018-03-13 10:57:49 -04:00
Nick Mathewson
1047ef140e Merge branch 'maint-0.3.3' 2018-03-13 13:41:33 +01:00
Nick Mathewson
676a28599d Merge branch 'maint-0.3.2' into maint-0.3.3 2018-03-13 13:41:24 +01:00
Nick Mathewson
53a807e1e9 Add a missing prototype to our libevent configure stanza.
Fixes bug 25474; bugfix on 0.3.2.5-alpha.
2018-03-13 13:37:26 +01:00
Isis Lovecruft
9191d962f9
changes: Fix changes file for bug25450.
It didn't like me insulting my patch, I guess.
2018-03-08 20:50:57 +00:00
Isis Lovecruft
0545f64d24
test: Increase time limit for IP creation in an HS test.
This should avoid most intermittent test failures on developer and CI machines,
but there could (and probably should) be a more elegant solution.

Also, this test was testing that the IP was created and its expiration time was
set to a time greater than or equal to `now+INTRO_POINT_LIFETIME_MIN_SECONDS+5`:

    /* Time to expire MUST also be in that range. We add 5 seconds because
     * there could be a gap between setting now and the time taken in
     * service_intro_point_new. On ARM, it can be surprisingly slow... */
    tt_u64_op(ip->time_to_expire, OP_GE,
              now + INTRO_POINT_LIFETIME_MIN_SECONDS + 5);

However, this appears to be a typo, since, according to the comment above it,
adding five seconds was done because the IP creation can be slow on some
systems.  But the five seconds is added to the *minimum* time we're comparing
against, and so it actually functions to make this test *more* likely to fail on
slower systems.  (It should either subtract five seconds, or instead add it to
time_to_expire.)

 * FIXES #25450: https://bugs.torproject.org/25450
2018-03-08 20:50:50 +00:00
Caio Valente
8775c93a99 Refactor: suppress duplicated functions from router.c and encapsulate NODE_DESC_BUF_LEN constant.
Also encapsulates format_node_description().

Closes ticket 25432.
2018-03-06 20:42:32 +01:00
Deepesh Pathak
930b985581
Fix redundant authority certificate fetch
- Fixes #24740
- Fetch certificates only in those cases when consensus are waiting for certs.
2018-03-04 21:13:58 +05:30
Nick Mathewson
699bb803ba Fix a crash bug when testing reachability
Fixes bug 25415; bugfix on 0.3.3.2-alpha.
2018-03-04 10:31:17 -05:00
Nick Mathewson
e5a990fc5a tweak changelog for 4187 2018-03-03 12:02:45 -05:00
Nick Mathewson
df9d2de441 Merge remote-tracking branch 'fristonio/ticket4187' 2018-03-03 12:02:30 -05:00
Nick Mathewson
338dbdab93 Merge branch 'maint-0.3.3' 2018-03-03 11:59:27 -05:00
Nick Mathewson
ccf0f77da1 changes file for 25378 2018-03-03 11:58:22 -05:00
Nick Mathewson
62482ea279 Merge branch 'maint-0.3.3' 2018-03-03 11:53:05 -05:00
Nick Mathewson
cc7de9ce1d Merge branch 'ticket23814' into maint-0.3.3 2018-03-03 11:53:01 -05:00
Alex Xu (Hello71)
45d3b5fa4c Remove uncompilable tor_mmap_file fallback. #25398 2018-03-02 09:51:53 -05:00
Nick Mathewson
d22963938f Merge branch 'maint-0.3.3' 2018-03-01 16:10:47 -05:00
Nick Mathewson
f7eff2f8c5 Merge branch 'maint-0.3.2' into maint-0.3.3 2018-03-01 16:10:43 -05:00
Nick Mathewson
d01abb9346 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-03-01 16:07:59 -05:00
Nick Mathewson
d4a758e083 Merge branch 'maint-0.2.9' into maint-0.3.1 2018-03-01 16:07:59 -05:00
Nick Mathewson
1fe0bae508 Forbid UINT32_MAX as a protocol version
The C code and the rust code had different separate integer overflow
bugs here.  That suggests that we're better off just forbidding this
pathological case.

Also, add tests for expected behavior on receiving a bad protocol
list in a consensus.

Fixes another part of 25249.
2018-03-01 16:05:17 -05:00
Nick Mathewson
8b405c609e Forbid "-0" as a protocol version.
Fixes part of 24249; bugfix on 0.2.9.4-alpha.
2018-03-01 16:05:17 -05:00
Nick Mathewson
a83650852d Add another NULL-pointer fix for protover.c.
This one can only be exploited if you can generate a correctly
signed consensus, so it's not as bad as 25074.

Fixes bug 25251; also tracked as TROVE-2018-004.
2018-03-01 16:05:17 -05:00
Nick Mathewson
65f2eec694 Correctly handle NULL returns from parse_protocol_list when voting.
In some cases we had checked for it, but in others we had not.  One
of these cases could have been used to remotely cause
denial-of-service against directory authorities while they attempted
to vote.

Fixes TROVE-2018-001.
2018-03-01 16:05:17 -05:00
Deepesh Pathak
130e2ffad7
Remove duplicate code between parse_{c,s}method in transport.c
- Merged common code in function parse_{c,s}method to a single function
- Removed duplicate code in transport.c
- Fixes #6236
2018-02-24 20:27:08 +05:30
Nick Mathewson
54e25ab124 Remove changes files for items already in 0.3.3. 2018-02-22 09:17:44 -05:00
Nick Mathewson
bcfb034957 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-02-21 11:53:50 -05:00
Nick Mathewson
62c88a6011 Merge branch 'maint-0.3.3' 2018-02-21 11:53:50 -05:00
Nick Mathewson
8a5cb58ad0 Merge branch 'maint-0.3.2' into maint-0.3.3 2018-02-21 11:53:50 -05:00
Nick Mathewson
ac1942ac58 Update the .gitmodules to refer to project-level tor-rust-dependencies
Closes most of #25323.
2018-02-21 11:53:04 -05:00
Nick Mathewson
a4ab273a0d Merge remote-tracking branch 'fristonio/ticket-25261' 2018-02-20 10:03:52 -05:00
Nick Mathewson
bd71e0a0c8 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-02-16 09:54:13 -05:00
Nick Mathewson
2bcd264a28 Merge branch 'maint-0.2.9' into maint-0.3.1 2018-02-16 09:48:11 -05:00
Nick Mathewson
cb92d47dec Merge remote-tracking branch 'dgoulet/ticket24902_029_05' into maint-0.2.9 2018-02-16 09:41:06 -05:00
Nick Mathewson
9f1899fdfd Merge branch 'maint-0.3.2' into maint-0.3.3 2018-02-16 08:49:08 -05:00
Nick Mathewson
5c48f62e67 Merge branch 'maint-0.3.3' 2018-02-16 08:49:08 -05:00
Nick Mathewson
c67adddacb Remove changes file for 24898-029 backports in maint-0.3.2
These patches were already merged, and so don't need a changes file
in these branches.
2018-02-16 08:48:46 -05:00
Nick Mathewson
8970058af6 Merge branch 'maint-0.3.2' into maint-0.3.3 2018-02-16 08:47:41 -05:00
Nick Mathewson
1527032384 Merge branch 'maint-0.3.3' 2018-02-16 08:47:41 -05:00
Nick Mathewson
c8b087d901 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-02-16 08:47:41 -05:00
Roger Dingledine
d21e5cfc24 stop calling channel_mark_client in response to a create_fast
since all it does is produce false positives

this commit should get merged into 0.2.9 and 0.3.0 *and* 0.3.1, even
though the code in the previous commit is already present in 0.3.1. sorry
for the mess.

[Cherry-picked]
2018-02-16 08:46:57 -05:00
Roger Dingledine
2b99350ca4 stop calling channel_mark_client in response to a create_fast
since all it does is produce false positives

this commit should get merged into 0.2.9 and 0.3.0 *and* 0.3.1, even
though the code in the previous commit is already present in 0.3.1. sorry
for the mess.
2018-02-16 08:46:31 -05:00
Roger Dingledine
8d5dcdbda2 backport to make channel_is_client() accurate
This commit takes a piece of commit af8cadf3a9 and a piece of commit
46fe353f25, with the goal of making channel_is_client() be based on what
sort of connection handshake the other side used, rather than seeing
whether the other side ever sent a create_fast cell to us.
2018-02-16 08:39:10 -05:00
Neel Chauhan
c2fa743806 Remove the return value of node_get_prim_orport() and node_get_prim_dirport() 2018-02-16 08:20:33 -05:00
Nick Mathewson
b56fd17d00 Merge branch 'maint-0.3.3' 2018-02-15 21:05:12 -05:00
Nick Mathewson
d662d4470a Merge remote-tracking branch 'dgoulet/ticket24343_033_01' into maint-0.3.3 2018-02-15 21:05:08 -05:00
Nick Mathewson
d9804691df Merge remote-tracking branch 'ffmancera-1/bug18918' 2018-02-15 21:00:10 -05:00
Nick Mathewson
92a42f795c Merge branch 'bug23909' 2018-02-15 20:56:23 -05:00
Nick Mathewson
8da6bfa5de Merge branch 'bug24914' 2018-02-15 20:53:50 -05:00
Nick Mathewson
ed1d630f0e Merge branch 'onion_ntor_malloc_less' 2018-02-15 20:40:03 -05:00
Nick Mathewson
a1dd8afc16 Merge branch '25162_zstd_static' 2018-02-15 20:28:07 -05:00
Nick Mathewson
3ca04aada2 Merge remote-tracking branch 'valentecaio/t-25081' 2018-02-15 20:23:23 -05:00
Nick Mathewson
3d7bf98d13 Merge remote-tracking branch 'valentecaio/t-24714' 2018-02-15 20:19:53 -05:00
Nick Mathewson
3c8a481599 Merge branch 'bug18105' 2018-02-15 20:17:31 -05:00
Nick Mathewson
3e2b48f8b4 Merge branch 'bug24484_squashed' 2018-02-15 20:13:53 -05:00
Nick Mathewson
4dc228e35b Remove workaround code for systems where free(NULL) is busted.
Add an autoconf test to make sure we won't regret it.

Closes ticket 24484.
2018-02-15 20:13:44 -05:00
Deepesh Pathak
3553383312
ticket 25261: Removed multiple includes of transports.h in connection.c 2018-02-15 22:28:34 +05:30
Nick Mathewson
f6a230ec95 Merge remote-tracking branch 'mikeperry/bug24769' 2018-02-14 10:03:14 -05:00
Nick Mathewson
9e566f3a72 Merge branch 'tests_rust' 2018-02-13 18:12:01 -05:00
Nick Mathewson
cb9a322b67 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-02-13 16:55:19 -05:00
Nick Mathewson
f647035b37 Merge branch 'maint-0.2.9' into maint-0.3.1 2018-02-13 16:55:18 -05:00
Taylor Yu
f0ed7895ca fix make check-changes 2018-02-13 15:07:55 -06:00
Nick Mathewson
86f461e362 Merge remote-tracking branch 'dgoulet/ticket24902_029_05' 2018-02-13 15:00:43 -05:00
David Goulet
e7f6314782 Make check-changes happy
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-13 14:56:31 -05:00
David Goulet
b60ffc5ce0 Merge remote-tracking branch 'dgoulet/bug25223_029_01' into ticket24902_029_05 2018-02-13 13:11:10 -05:00
David Goulet
305e39d0f8 dos: Add extra safety asserts in cc_stats_refill_bucket()
Never allow the function to set a bucket value above the allowed circuit
burst.

Closes #25202

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-13 10:41:21 -05:00
David Goulet
4fe4f8179f dos: Don't set consensus param if we aren't a public relay
We had this safeguard around dos_init() but not when the consensus changes
which can modify consensus parameters and possibly enable the DoS mitigation
even if tor wasn't a public relay.

Fixes #25223

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-13 10:35:41 -05:00
Nick Mathewson
412a8256a5 Remove 25170 changes file from master: it was already merged in 0.3.3.2-alpha 2018-02-13 08:51:29 -05:00
Nick Mathewson
b062730a11 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-02-13 08:50:59 -05:00
Nick Mathewson
5e3c545af7 Merge branch 'maint-0.3.2' 2018-02-13 08:50:59 -05:00
Nick Mathewson
17a923941a Merge branch 'maint-0.2.9' into maint-0.3.1 2018-02-13 08:50:58 -05:00
David Goulet
e658dad625 dirserv: Improve returned message when relay is rejected
Explicitly inform the operator of the rejected relay to set a valid email
address in the ContactInfo field and contact bad-relays@ mailing list.

Fixes #25170

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-13 08:47:42 -05:00
Fernando Fernandez Mancera
eb089ecaa0 Improve the documentation of AccountingStart parameter.
Fixes #23635.

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2018-02-12 17:10:04 +01:00
Nick Mathewson
91109bc813 Merge branch 'maint-0.2.9' into maint-0.3.1 2018-02-12 08:33:47 -05:00
Nick Mathewson
e91bae66d8 Merge branch 'bug23318-redux_029' into maint-0.2.9 2018-02-12 08:33:03 -05:00
Nick Mathewson
b2c4d4e7fa Merge branch 'maint-0.2.9' into maint-0.3.1 2018-02-11 18:11:04 -05:00
Nick Mathewson
84c13336c4 Merge remote-tracking branch 'public/bug24198_029' into maint-0.2.9 2018-02-11 18:10:59 -05:00
Nick Mathewson
8939eaf479 Merge branch 'maint-0.2.9' into maint-0.3.1 2018-02-11 18:09:35 -05:00
Nick Mathewson
848ba26c18 Merge branch 'ticket24315_029' into maint-0.2.9 2018-02-11 18:07:37 -05:00
Nick Mathewson
684d57fe8a Merge branch 'maint-0.3.1' into maint-0.3.2 2018-02-11 17:00:52 -05:00
Nick Mathewson
eccef6ba60 Merge branch 'maint-0.2.9' into maint-0.3.1 2018-02-11 16:51:56 -05:00
Nick Mathewson
5dc785ceef Merge remote-tracking branch 'public/bug21074_029' into maint-0.2.9 2018-02-11 16:51:53 -05:00
Nick Mathewson
3834441a72 chnages file for 25120 2018-02-11 16:14:19 -05:00
Nick Mathewson
4de20d1754 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-02-10 16:09:01 -05:00
Nick Mathewson
1df701c082 Merge branch 'maint-0.3.2' 2018-02-10 16:09:01 -05:00
Nick Mathewson
86583ad78e Merge branch 'maint-0.2.9' into maint-0.3.1 2018-02-10 16:09:00 -05:00
Nick Mathewson
320dac4602 Merge branch 'bug24978_029_enable' into maint-0.2.9 2018-02-10 16:08:58 -05:00
Nick Mathewson
e5d78c70b0 Begin work on a changelog 2018-02-09 15:58:26 -05:00
Nick Mathewson
549a450f52 Add a "make test-rust" target to run the rust tests only. 2018-02-08 17:51:57 -05:00
Nick Mathewson
8d142e2322 Merge remote-tracking branch 'isis/bug25127' 2018-02-08 17:16:14 -05:00
Nick Mathewson
84bc75b2e7 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-02-08 10:29:06 -05:00
Nick Mathewson
cce76fbbe2 Merge branch 'maint-0.3.2' 2018-02-08 10:29:06 -05:00
Nick Mathewson
04a8e81fa9 Merge branch 'maint-0.2.9' into maint-0.3.1 2018-02-08 10:29:05 -05:00
Nick Mathewson
0ddc2dc531 Merge branch 'maint-0.2.5' into maint-0.2.9 2018-02-08 10:29:05 -05:00
David Goulet
211fe44e07 dirserv: Improve returned message when relay is rejected
Explicitly inform the operator of the rejected relay to set a valid email
address in the ContactInfo field and contact bad-relays@ mailing list.

Fixes #25170

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-08 09:42:26 -05:00
Karsten Loesing
f1278b7e57 Update geoip and geoip6 to the February 7 2018 database. 2018-02-08 10:32:41 +01:00
David Goulet
652d3a5b66 Remove anything related to the old SocksSockets option
At this commit, the SocksSocketsGroupWritable option is renamed to
UnixSocksGroupWritable. A deprecated warning is triggered if the old option is
used and tor will use it properly.

Fixes #24343

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-07 14:05:33 -05:00
Nick Mathewson
12b58ba551 Merge remote-tracking branch 'dgoulet/ticket25163_033_01' 2018-02-07 12:46:27 -05:00
Nick Mathewson
78382d557a Merge remote-tracking branch 'dgoulet/bug25113_029_01' 2018-02-07 11:33:14 -05:00
David Goulet
fe3dfe7e38 test: Bump to 10 msec gap in the monotonic test
On slow system, 1 msec between one read and the other was too tight. For
instance, it failed on armel with a 4msec gap:

  https://buildd.debian.org/status/package.php?p=tor&suite=experimental

Increase to 10 msec for now to address slow system. It is important that we
keep this OP_LE test in so we make sure the msec/usec/nsec read aren't
desynchronized by huge gaps. We'll adjust again if we ever encounter a system
that goes slower than 10 msec between calls.

Fixes #25113

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-07 10:50:52 -05:00
Nick Mathewson
a45b56753c changes file for 23650 typo fixes 2018-02-07 10:44:21 -05:00
David Goulet
93ebcc2b8f rephist: Stop tracking relay connection status
Remove a series of connection counters that were only used when dumping the
rephist statistics with SIGUSR1 signal.

This reduces the or_history_t structure size.

Closes #25163

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-06 12:56:36 -05:00
Nick Mathewson
6961609a1c Merge remote-tracking branch 'dgoulet/bug25116_029_01' 2018-02-06 12:13:41 -05:00
Nick Mathewson
a384937f84 Merge branch 'arma_bug22212_031' 2018-02-06 11:41:52 -05:00
Nick Mathewson
5a1e0bfcdc Add a category for the 22212-forreal changes file 2018-02-06 11:41:31 -05:00
Nick Mathewson
87db5a6b75 Merge remote-tracking branch 'arma/bug22212' 2018-02-06 11:36:13 -05:00
Nick Mathewson
358b609e9d Enable (safe) use of zstd static-only APIs
We'll only use these when the compile-time version and the run-time
version of the zstd library match.  Part of ticket 25162.
2018-02-06 11:05:07 -05:00
Isis Lovecruft
7ea9e080c5
protover: Fix memleak in Rust implementation.
* FIXES #25127: https://bugs.torproject.org/25127.
2018-02-06 02:56:16 +00:00
David Goulet
7ce8d5513b Make circuit_log_ancient_one_hop_circuits() ignore established service rendezvous
Services can keep rendezvous circuits for a while so don't log them if tor is
a single onion service.

Fixes #25116

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-05 13:46:43 -05:00
Nick Mathewson
e3d4154486 Avoid a malloc/free pair for each (server-side) ntor handshake
Closes ticket 25150
2018-02-05 11:53:33 -05:00
Deepesh Pathak
1c8f55310f
Rename a verified unverified-consensus to cached-consensus on the disk
- Fixes ticket #4187
- Change the name of a unverified-*consensus to cached-*consensus
on disk when it has been verified.
2018-02-03 06:45:52 +05:30
Nick Mathewson
eafa252b26 Merge remote-tracking branch 'dgoulet/ticket24902_029_05' 2018-02-02 15:00:35 -05:00
David Goulet
475218c108 Merge branch 'ticket25122_029_02' into ticket24902_029_05 2018-02-02 14:55:01 -05:00
David Goulet
51839f4765 geoip: Hook the client history cache into the OOM handler
If the cache is using 20% of our maximum allowed memory, clean 10% of it. Same
behavior as the HS descriptor cache.

Closes #25122

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-02 14:48:41 -05:00
Nick Mathewson
77634795b0 Merge remote-tracking branch 'dgoulet/bug24700_032_01' into maint-0.3.2 2018-02-01 16:57:57 -05:00
David Goulet
e1a40535ea Merge branch 'bug24700_032_01' into bug24700_033_01 2018-02-01 16:39:04 -05:00
Nick Mathewson
31542cc306 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-02-01 15:28:17 -05:00
Nick Mathewson
9773cd0f94 Merge branch 'maint-0.3.2' 2018-02-01 15:28:17 -05:00
Nick Mathewson
9cbc40e376 Merge remote-tracking branch 'teor/bug25070_031' into maint-0.3.1 2018-02-01 15:28:11 -05:00
Nick Mathewson
c2757c3774 Remove nodelist_recompute_all_hsdir_indices() as unused.
Closes 25108.
2018-02-01 08:44:47 -05:00
Nick Mathewson
ea8e9f17f5 Revert "Change the sandbox behavior on all failed opens() to EACCES"
This reverts commit 9a06282546.

It appears that I misunderstood how the seccomp2 filter rules
interact.  It appears that `SCMP_ACT_ERRNO()` always takes
precedence over `SCMP_ACT_ALLOW()` -- I had thought instead that
earlier rules would override later ones.  But this change caused bug
25115 (not in any released Tor).
2018-02-01 08:39:38 -05:00
Nick Mathewson
88b146cda5 Merge remote-tracking branch 'dgoulet/bug24469_033_01' 2018-02-01 08:22:44 -05:00
Nick Mathewson
ca85d66217 Merge branch 'maint-0.3.2' 2018-02-01 08:15:09 -05:00
Nick Mathewson
61cb2993dd Merge remote-tracking branch 'dgoulet/bug24975_032_01' into maint-0.3.2 2018-02-01 08:10:34 -05:00
Caio Valente
7884ce76e1 refactor: rename connection_t struct fields.
connection_t.timestamp_lastwritten renamed to
connection_t.timestamp_last_write_allowed

connection_t.timestamp_lastread renamed to
connection_t.timestamp_last_read_allowed

Closes ticket 24714.
2018-02-01 03:12:38 +01:00
Caio Valente
ad06e0b406 Changes file for ticket 25081. 2018-02-01 02:25:08 +01:00
Nick Mathewson
d1c2597096 Merge remote-tracking branch 'dgoulet/ticket24902_029_05' 2018-01-31 16:17:04 -05:00
Fernando Fernandez Mancera
33d9889a2b channel_tls_get_remote_addr_method now returns real_addr.
The accurate address of a connection is real_addr, not the addr member.
channel_tls_get_remote_addr_method() now returns real_addr instead.

Fixes #24952; bugfix on 707c1e2 in 0.2.4.11-alpha.

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2018-01-31 16:12:13 -05:00
David Goulet
fb93c6fc51 circ: Don't cannibalize a circuit if the guard state is unusable
Tor preemptiely builds circuits and they can be cannibalized later in their
lifetime. A Guard node can become unusable (from our guard state) but we can
still have circuits using that node opened. It is important to not pick those
circuits for any usage through the cannibalization process.

Fixes #24469

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-01-31 16:10:48 -05:00
Nick Mathewson
8b0b850efa Merge remote-tracking branch 'public/bug16106_02_nm' 2018-01-31 15:51:58 -05:00
Nick Mathewson
a846fd267e Merge branch 'bug23954_squashed' 2018-01-31 14:37:48 -05:00
Nick Mathewson
da778f2921 Use thread-safe types to store the LOG_PROTOCOL_WARN severity
Fixes a race condition; resolves 23954.
2018-01-31 14:37:09 -05:00
Nick Mathewson
98dd3757bf Merge branch 'bug25008' 2018-01-31 14:32:24 -05:00
David Goulet
fbc455cbd2 ns: Add a before and after consensus has changed notification
In 0.3.2.1-alpha, we've added notify_networkstatus_changed() in order to have
a way to notify other subsystems that the consensus just changed. The old and
new consensus are passed to it.

Before this patch, this was done _before_ the new consensus was set globally
(thus NOT accessible by getting the latest consensus). The scheduler
notification was assuming that it was set and select_scheduler() is looking at
the latest consensus to get the parameters it might needs. This was very wrong
because at that point it is still the old consensus set globally.

This commit changes the notify_networkstatus_changed() to be the "before"
function and adds an "after" notification from which the scheduler subsystem
is notified.

Fixes #24975
2018-01-31 14:15:02 -05:00
Nick Mathewson
31f2a8771c Look at the correct protocol for supports_v3_rendezvous_point
Fixes bug 25105; bugfix on 0.3.2.1-alpha.

(This is a backport of bbf2d9cf6b for 0.3.2.)
2018-01-31 14:09:47 -05:00
Nick Mathewson
bbf2d9cf6b Look at the correct protocol for supports_v3_rendezvous_point
Fixes bug 25105; bugfix on 0.3.2.1-alpha.
2018-01-31 14:01:49 -05:00
David Goulet
c85f78e74c Revert "ns: Call notify_networkstatus_changed() after the new consensus is set globally"
This reverts commit 3a247ca92a.
2018-01-31 13:59:05 -05:00
Nick Mathewson
0dc1595d03 Merge branch 'maint-0.3.2' 2018-01-31 13:47:01 -05:00
Nick Mathewson
1c39d969b9 Merge remote-tracking branch 'dgoulet/bug24975_032_01' into maint-0.3.2 2018-01-31 13:46:58 -05:00
David Goulet
adaf3e9b89 sched: Avoid adding the same channel twice to the KIST pending list
This is the quick fix that is keeping the channel in PENDING state so if we
ever try to reschedule the same channel, it won't happened.

Fixes #24700

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-01-31 13:46:31 -05:00
Nick Mathewson
2294e330bd Merge branch 'maint-0.3.2' 2018-01-31 12:51:45 -05:00
David Goulet
df312b3cf6 hs-v3: Remove a BUG() when storing a descriptor in the client cache
It is possible in normal circumstances that  a client fetches a descriptor
that has a lower revision counter than the one in its cache. This can happen
due to HSDir desync.

Fixes #24976

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-01-31 12:51:42 -05:00
Mike Perry
b65c67f0e4 Changes file for bug24769. 2018-01-31 17:21:53 +00:00
Mike Perry
148c2410af Bug 24769: Reduce and parameterize the cbt learning idle timeout.
This is only half of the changes needed. We should also parameterize the
number of concurrent cbt learning circuits in needs_circuits_for_build().
2018-01-31 17:21:53 +00:00
David Goulet
3a247ca92a ns: Call notify_networkstatus_changed() after the new consensus is set globally
In 0.3.2.1-alpha, we've added this function in order to have a way to notify
other subsystems that the consensus just changed. The old consensus and the
new one are passed to it.

Before this patch, this was done _before_ the new consensus was set globally
(thus NOT accessible by getting the latest consensus). The scheduler
notification was assuming that it was set and select_scheduler() is looking at
the latest consensus to get the parameters it might needs. This was very wrong
because at that point it is still the old consensus set globally.

With this commit, notify_networkstatus_changed() has been moved _after_ the
new consensus is set globally. The main obvious reasons is to fix the bug
described above and in #24975. The other reason is that this notify function
doesn't return anything which could be allowing the possibility of refusing to
set the new consensus on error. In other words, the new consensus is set right
after the notification whatever happens.

It does no harm or change in behavior to set the new consensus first and then
notify the subsystems. The two functions currently used are for the control
port using the old and new consensus and sending the diff. The second is the
scheduler that needs the new consensus to be set globally before being called.

Of course, the function has been documented accordinly to clearly state it is
done _after_ the new consensus is set.

Fixes #24975

Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-01-31 11:21:18 -05:00
Nick Mathewson
69e242f845 Merge branch 'maint-0.3.2' 2018-01-31 09:50:24 -05:00
Nick Mathewson
e81896adda Merge branch 'maint-0.3.1' into maint-0.3.2 2018-01-31 09:50:24 -05:00
Nick Mathewson
914ec372a9 Merge branch 'bug24927' 2018-01-31 09:47:36 -05:00
Nick Mathewson
80c8689be1 Merge remote-tracking branch 'public/ticket24849_032' 2018-01-31 09:38:24 -05:00
Nick Mathewson
c0447033f5 Merge branch 'maint-0.3.2' 2018-01-31 09:19:55 -05:00
Roger Dingledine
3d9dcb49eb count flushing as channel activity
Stop adding unneeded channel padding right after we finish flushing
to a connection that has been trying to flush for many seconds.
Instead, treat all partial or complete flushes as activity on the
channel, which will defer the time until we need to add padding.

This fix should resolve confusing and scary log messages like
"Channel padding timeout scheduled 221453ms in the past."

Fixes bug 22212; bugfix on 0.3.1.1-alpha.

I think technically we could resolve bug 22212 by adding a call to
channel_timestamp_active() only in the finished_flushing case. But I added
a call in the flushed_some case too since that seems to more accurately
reflect the notion of "active".
2018-01-31 05:26:06 -05:00
David Goulet
cd81403cc0 Merge branch 'ticket24902_029_05' into ticket24902_033_02 2018-01-30 09:33:12 -05:00
David Goulet
9aca7d4730 dos: Add changes file for ticket 24902
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-01-30 09:18:16 -05:00
teor
9656ad3232
Changes file for 25070 2018-01-30 02:08:42 +11:00
Nick Mathewson
75d4bd3497 Improve log when unable to add sigs to pending consensus
Closes ticket 24849.
2018-01-26 14:19:59 -05:00
Nick Mathewson
ee5c624beb When a tor_cert_T check fails, log the reason why.
Diagnostic attempt for 24972.
2018-01-26 13:55:25 -05:00
Nick Mathewson
0755bcc36a Remove a needless (always-true) check.
Also add an assertion and rename a variable.

Closes ticekt 24927.
2018-01-26 13:35:00 -05:00
Nick Mathewson
9c2bc441f8 If out-of-disk when saving a consensus cache entry, don't BUG.
Just warn instead.

Fixes bug 24859.
2018-01-26 13:14:14 -05:00
Nick Mathewson
aedcb1644d Improve the keypin-loading log message to be a bit less scary. 2018-01-26 12:39:38 -05:00
Nick Mathewson
9a06282546 Change the sandbox behavior on all failed opens() to EACCES
Previously, most disallowed open(O_RDONLY) attempts would EACCES,
but others would fail with a crash.
2018-01-26 12:18:43 -05:00
Nick Mathewson
6ed384b827 Use tor_addr_from_getsockname() in several places
I'm leaving the getsockname code in transproxy alone, since it is
comparatively isolated, rather platform-specific, and hard to test.

Implements 18105.
2018-01-26 12:08:15 -05:00
Nick Mathewson
cd4fd9887b fixup! Remove the old ("deterministic") download schedule.
oops, fix the bug number.
2018-01-25 16:05:09 -05:00
Nick Mathewson
e0049ef022 Remove the old ("deterministic") download schedule.
We haven't meant to use it since we introduced the random
exponential schedule.

Closes ticket 23814.
2018-01-25 15:51:13 -05:00
Nick Mathewson
91c63aae84 In relay_digest_matches(), use stack instead of heap.
We'd been using crypto_digest_dup() and crypto_digest_assign() here,
but they aren't necessary.  Instead we can just use the stack to
store the previous state of the SHA_CTX and avoid a malloc/free pair.

Closes ticket 24914.
2018-01-25 13:59:55 -05:00
Alexander Færøy
162d75d587
Update HiddenServiceVersion man-page entry to only accept either 2 or 3.
This patch updates the HiddenServiceVersion man-page entry to only
accept either 2 or 3 as argument and not a list of multiple versions.

See: https://bugs.torproject.org/25026
2018-01-25 16:59:09 +01:00
Nick Mathewson
2d5bab6afb Start on a changelog for 0.3.1.1-alpha 2018-01-24 17:08:13 -05:00
Nick Mathewson
fdc1cc9b44 Remove changes files that also appeared in 0.3.2.9 2018-01-24 17:01:44 -05:00
Fernando Fernandez Mancera
5ea993fa5a Clarify directory and ORPort checking functions.
In order to make the OR and dir checking functions in router.c less confusing
we renamed some functions and splitted consider_testing_reachability() into
router_should_check_reachability() and router_do_reachability_checks(). Also we
improved the documentation.

Fixes #18918.

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2018-01-24 20:19:24 +01:00
Nick Mathewson
7e504515b3 Always look at the subprotocol versions summary flags
Previously, we wouldn't do this when running with a routerinfo_t in
some cases, leading to many needless calls to the protover module.

This change also cleans up the code in nodelist.c a bit.

Fixes bug 25008; bugfix on 0.2.9.4-alpha.
2018-01-24 13:53:56 -05:00
Nick Mathewson
fd8ee1d7c3 Merge branch 'maint-0.3.2' 2018-01-24 12:09:07 -05:00
Nick Mathewson
6ba2881aec Fix a memory leak in scheduler/loop_kist
Fixes bug 25005.
2018-01-24 12:07:45 -05:00
Nick Mathewson
6f4ee6e5e7 Merge remote-tracking branch 'mikeperry/bug24946' 2018-01-23 14:08:47 -05:00
Nick Mathewson
0dbe3ddc33 Make Tor support TLS1.3 ciphers with OpenSSL 1.1.1
Without this patch, not only will TLS1.3 not work with Tor, but
OpenSSL 1.1.1 with TLS1.3 enabled won't build any connections at
all: It requires that either TLS1.3 be disabled, or some TLS1.3
ciphersuites be listed.

Closes ticket 24978.
2018-01-23 09:23:21 -05:00
George Kadianakis
17daab76b8 Add onion service activity information to our heartbeat logs. 2018-01-23 12:31:06 +02:00
Mike Perry
db5b670d85 Bug 24946: Fix a warning message caused by a missed purpose check.
Also fix three other checks (found by inspection of all
CIRCUIT_PURPOSE_C_GENERAL occurrences).
2018-01-20 03:18:31 +00:00
Nick Mathewson
1bcbb1bb0b Merge remote-tracking branch 'mikeperry/bug23101-mergeready-squashed' 2018-01-19 17:28:10 -05:00
Mike Perry
489628a7e4 Bug 23101: Pre-build HS-specific circuits (instead of general).
Prebuilt circs are 4 hops, since only server side HSDIR and intro circs
are 3 hops, and it is OK if those sometimes take longer to build.
2018-01-19 22:21:49 +00:00
Mike Perry
20a3f61105 Implement layer 2 and layer 3 guard pinning via torrc.
Block circuit canibalization when HSRendezvousMiddleNodes is active.
Also make it apply to all HS circuits, not just rends.
2018-01-19 22:21:48 +00:00
Nick Mathewson
edd427a8ba Merge branch 'disable_signal_handlers' 2018-01-19 16:35:24 -05:00
Nick Mathewson
df4d5ebb7d Merge branch 'maint-0.3.2' 2018-01-19 16:30:53 -05:00
David Goulet
f870f9c8bc Merge branch 'bug24895_031_02' into bug24895_032_02 2018-01-19 16:26:26 -05:00
David Goulet
f98f7ca898 Merge branch 'bug24895_029_02' into bug24895_031_02 2018-01-19 16:21:55 -05:00
Roger Dingledine
490ae26b24 hs: Use hs_service_max_rdv_failures consensus param, defaulting to 2 2018-01-19 16:13:54 -05:00
Nick Mathewson
2c9e0a286c Merge branch 'restart_debug_squashed' 2018-01-19 09:52:14 -05:00
Nick Mathewson
97d9ba2380 Add a mostly disabled feature to debug restarting in-process
For 23847, we want Tor to be able to shut down and then restart in
the same process.  Here's a patch to make the Tor binary do that.
To test it, you need to build with --enable-restart-debugging, and
then you need to set the environment variable TOR_DEBUG_RESTART.
With this option, Tor will then run for 5 seconds, then restart
itself in-process without exiting.  This only happens once.

You can change the 5-second interval using
TOR_DEBUG_RESTART_AFTER_SECONDS.

Implements ticket 24583.
2018-01-19 09:52:05 -05:00
Roger Dingledine
a15eb9ff43 MAX_REND_FAILURES is 1, but we would try three times
Fix an "off by 2" error in counting rendezvous failures on the onion
service side.

While we thought we would stop the rendezvous attempt after one failed
circuit, we were actually making three circuit attempts before giving up.

Fixes bug 24895; bugfix on 0.0.6.
2018-01-19 02:28:55 -05:00
Nick Mathewson
44388757c4 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-01-18 08:13:48 -05:00
Nick Mathewson
c8a27d89b2 Merge branch 'maint-0.3.2' 2018-01-18 08:13:48 -05:00
Nick Mathewson
f406b9df05 Merge branch 'bug24826_031' into maint-0.3.1 2018-01-18 08:13:45 -05:00
Nick Mathewson
77026f8a87 Merge branch 'bug22798_029_squashed' 2018-01-17 13:26:41 -05:00
Nick Mathewson
959af20247 Merge branch 'maint-0.3.2' 2018-01-17 11:13:18 -05:00
Nick Mathewson
4e653ac2ca Merge branch 'maint-0.3.1' into maint-0.3.2 2018-01-17 11:12:15 -05:00
Nick Mathewson
86aa7f0a3f Merge branch 'maint-0.3.2' 2018-01-17 10:50:58 -05:00
Nick Mathewson
f02c6bcad0 Merge remote-tracking branch 'arma/bug24894' into maint-0.3.2 2018-01-17 10:49:45 -05:00
Nick Mathewson
1efb84215e Improve Windows performance with SIO_IDEAL_SEND_BACKLOG_QUERY.
Patch written by "Vort" on trac. Addresses ticket 22798.
2018-01-17 10:40:00 -05:00
Nick Mathewson
5970836af8 fix a check-changes warning 2018-01-16 14:41:43 -05:00
Nick Mathewson
454d854363 Merge branch 'bug21074_029' 2018-01-16 14:13:39 -05:00
Nick Mathewson
f470756cf4 Merge branch 'maint-0.3.2' 2018-01-16 13:36:48 -05:00
Nick Mathewson
0cb89eb828 Merge remote-tracking branch 'public/bug24652_032' into maint-0.3.2 2018-01-16 13:35:52 -05:00
Nick Mathewson
4bb831e087 Improve fragile-hardening performance of consensus_split_lines.
For whatever reason, in my testing, using memchr() here improves
performance over strchr() by a great deal.

Fixes bug 24826; bugfix on 0.3.1.1-alpha.
2018-01-16 12:42:40 -05:00
Roger Dingledine
af8cadf3a9 Remove false positives from channel_is_client()
Fix a set of false positives where relays would consider connections
to other relays as being client-only connections (and thus e.g.
deserving different link padding schemes) if those relays fell out
of the consensus briefly.

Now we look only at the initial handshake and whether the connection
authenticated as a relay.

Fixes bug 24898; bugfix on 0.3.1.1-alpha.
2018-01-15 22:33:40 -05:00
Roger Dingledine
7ce335c921 v3 onion services now obey MAX_REND_FAILURES
New-style (v3) onion services now obey the "max rendezvous circuit
attempts" logic.

Previously they would make as many rendezvous circuit attempts as they
could fit in the MAX_REND_TIMEOUT second window before giving up.

Fixes bug 24894; bugfix on 0.3.2.1-alpha.
2018-01-15 16:41:47 -05:00
Nick Mathewson
a86324d1fa Remove a needless changefile. (Needless because bug not released.) 2018-01-12 13:30:06 -05:00
Nick Mathewson
edc87b263f Merge remote-tracking branch 'ffmancera/bug24861' 2018-01-12 13:29:53 -05:00
Fernando Fernandez Mancera
06368e5310 Fix minGW compatibility issue with zu format specifier.
Define TOR_PRIuSZ as minGW compiler doesn't support zu format specifier for
size_t type.

Fixes #24861 on ac9eebd.

Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2018-01-12 17:44:30 +01:00
Nick Mathewson
4c651b8c04 Note contactinfo and myfamily as required in more places
Includes a sentence from cypherpunks; for ticket 24526.
2018-01-11 20:00:18 -05:00
Nick Mathewson
a3d1c38ea6 Merge branch 'bug24582' 2018-01-11 19:57:57 -05:00
Nick Mathewson
18ea91ee6b Make the warnings about restarting tor in-process more scary. 2018-01-11 12:46:50 -05:00
Nick Mathewson
05ac3d0458 Merge branch 'restart_nocrash' 2018-01-11 12:45:25 -05:00
Nick Mathewson
c349bfec36 Merge branch 'bug24526_squashed' 2018-01-11 12:33:52 -05:00
Nick Mathewson
ac0f819ce5 Note contactinfo and myfamily as required in more places
Includes a sentence from cypherpunks; for ticket 24526.
2018-01-11 12:33:30 -05:00
Nick Mathewson
d0adf5ae95 Merge branch 'bug24584' 2018-01-11 12:28:29 -05:00
Nick Mathewson
7a60600411 Merge remote-tracking branch 'ffmancera/github/bug24573' 2018-01-11 08:31:25 -05:00
Nick Mathewson
c8c258a433 Merge branch 'bug24733_squashed_2' 2018-01-10 12:57:23 -05:00
teor
54899b404c Stop invoking undefined behaviour by using tor_free() on an unaligned pointer
... in get_interface_addresses_ioctl().

This pointer alignment issue exists on x86_64 macOS, but is unlikely to exist
elsewhere. (i386 macOS only requires 4-byte alignment, and other OSs have
8-byte ints.)

Fixes bug 24733; not in any released version of tor.
2018-01-10 12:57:13 -05:00
Nick Mathewson
ca1d1c382c Merge remote-tracking branch 'ffmancera/github/bug24501' 2018-01-10 12:46:39 -05:00
Nick Mathewson
4715d81809 Merge remote-tracking branch 'teor/Bug-23966' 2018-01-10 09:38:38 -05:00
Nick Mathewson
2d2a0c4116 ticket 22145 changes file 2018-01-10 09:35:11 -05:00
Nick Mathewson
9ba69be96c Merge branch 'maint-0.3.2'
There was a merge conflict on fallback_dirs.inc, which we resolve in
favor of the newly generated version for #24801.
2018-01-08 11:10:53 -05:00
Nick Mathewson
e3ab27001f Merge branch 'maint-0.3.0' into maint-0.3.1 2018-01-08 11:10:36 -05:00
Nick Mathewson
1c5c5f0e50 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-01-08 11:10:36 -05:00
Nick Mathewson
b85fa0bd5f Merge branch 'maint-0.2.9' into maint-0.3.0 2018-01-08 11:10:36 -05:00
Nick Mathewson
9464da210d Add changes file for new fallback directory list. 2018-01-08 11:09:08 -05:00
Nick Mathewson
748ad2124d Merge branch 'maint-0.3.1' into maint-0.3.2 2018-01-08 09:35:55 -05:00
Nick Mathewson
942fa0c4a2 Merge branch 'maint-0.3.2' 2018-01-08 09:35:55 -05:00
Nick Mathewson
a1ce1ab201 Merge branch 'maint-0.3.0' into maint-0.3.1 2018-01-08 09:34:57 -05:00
Nick Mathewson
8042c356f4 Merge branch 'maint-0.2.9' into maint-0.3.0 2018-01-08 09:34:56 -05:00
Nick Mathewson
26e28829da Merge branch 'maint-0.2.5' into maint-0.2.9 2018-01-08 09:34:56 -05:00
Karsten Loesing
8efbeb0982 Update geoip and geoip6 to the January 5 2018 database. 2018-01-08 11:36:38 +01:00
Nick Mathewson
143da73165 Merge remote-tracking branch 'teor/fallback-code-2018-01' 2018-01-05 16:47:28 -05:00
Nick Mathewson
0b6fe3c123 Merge branch 'maint-0.3.2' 2018-01-05 16:41:35 -05:00
Nick Mathewson
48d94e290d Merge branch 'maint-0.3.0' into maint-0.3.1 2018-01-05 16:41:34 -05:00
Nick Mathewson
16fd975a82 Merge branch 'maint-0.2.9' into maint-0.3.0 2018-01-05 16:41:34 -05:00
Nick Mathewson
3618bd6166 Merge branch 'maint-0.3.1' into maint-0.3.2 2018-01-05 16:41:34 -05:00
Nick Mathewson
c52d4d9e34 Merge branch 'teor_ticket24681_028' into maint-0.2.9 2018-01-05 16:41:31 -05:00
teor
65520f1bde
Stop logging excessive information about fallback netblocks
Implements ticket 24791
2018-01-05 13:28:17 +11:00
teor
d30d3fe8ed
Adjust fallback selection parameters
Avoid selecting fallbacks that change their IP addresses too often.

Select more fallbacks by ignoring the Guard flag, and allowing lower
cutoffs for the Running and V2Dir flags. Also allow a lower bandwidth,
and a higher number of fallbacks per operator (5% of the list).

Implements ticket 24785.
2018-01-05 13:28:13 +11:00
teor
91a8b37a2e
Make updateFallbackDirs.py search harder for python
(Some OSs don't put it in /usr/bin.)

Fixes bug 24708; bugfix on 0.2.8.1-alpha.
2018-01-05 13:28:05 +11:00
teor
2ae33e486e
Revise the generateFallbackDirLine.py script to use descriptors
Patch by atagar, part of #24706.
2018-01-05 13:28:01 +11:00
teor
e244738bbd
Add fallback directory mirror helper scripts
Add the generateFallbackDirLine.py script for automatically generating
fallback directory mirror lines from relay fingerprints. No more typos!

Add the lookupFallbackDirContact.py script for automatically looking up
operator contact info from relay fingerprints.

Implements ticket 24706.
2018-01-05 13:27:55 +11:00
teor
b6033f5734
Add a delimiter to the end of each fallback entry
This helps external parsers.

Also, add comments indicating where to add new fields in the fallback
format.

Part of 24725.
2018-01-05 13:27:32 +11:00
teor
beedf5fd81
Remove commas and equals signs from external string inputs to the fallback list
This makes sure that list parsers only see one comma per fallback entry,
and only see one equals sign per field.

Implements ticket 24726.
2018-01-05 13:27:22 +11:00
teor
6a27fc6245
Add an extrainfo cache flag for each fallback in a C comment
This allows stem to use fallbacks to fetch extra-info documents,
rather than using authorities.

Implements ticket 22759.
2018-01-05 13:27:14 +11:00
teor
561f18e724
Add a nickname to each fallback in a C comment
This makes it easier for operators to find their relays, and allows stem to
use nicknames to identify fallbacks.

Implements ticket 24600.
2018-01-05 13:27:07 +11:00
teor
ac5058ac8a
Remove the "weight=10" line from fallback directory mirror entries
This removes some redundant repeated lines.

Ticket 24681 will maintain the current fallback weights by changing
Tor's default fallback weight to 10.

Implements ticket 24679.
2018-01-05 13:26:53 +11:00
teor
8d226a2c7b
Add a type and version header to the fallback directory mirror file
This helps external parsers like stem and Relay Search.

Implements ticket 24725.
2018-01-05 13:26:44 +11:00
teor
e3a2324083
Add a changes file for 22321, that mentions all its children and 24678 2018-01-05 13:26:38 +11:00
teor
9a0cf2376d
Update comment and add changes file for 20942 2018-01-05 13:26:14 +11:00
Nick Mathewson
2ac9734bd2 Use -lresolv in LIBS with rust on OSX.
This fixes issue #24652, and is a workaround for Rust issue
https://github.com/rust-lang/rust/issues/46797 .
2018-01-04 14:02:24 -05:00
Nick Mathewson
68ca6d2e19 Don't treat a setrlimit failure as fatal.
Fixes bug 21074; bugfix on 4689243242 in 0.0.9rc5 when we
started doing setrlimit() in the first place.
2018-01-04 13:21:29 -05:00
Nick Mathewson
943134e886 Merge remote-tracking branch 'pastly2/ticket24531_033_01' 2018-01-03 11:56:35 -05:00
Nick Mathewson
6b3c07648c Merge branch 'maint-0.3.2' 2018-01-03 10:09:20 -05:00
Nick Mathewson
1bc95633fb Fix some shadowed-global warnings.
These are all about local variables shadowing global
functions. That isn't normally a problem, but at least one
compiler we care about seems to treat this as a case of -Wshadow
violation, so let's fix it.

Fixes bug 24634; bugfix on 0.3.2.1-alpha.
2018-01-03 09:13:00 -05:00
Nick Mathewson
b62b40a572 Merge branch 'maint-0.3.2' 2018-01-03 09:00:00 -05:00
Nick Mathewson
451c852a0f Merge branch 'maint-0.3.1' into maint-0.3.2 2018-01-03 09:00:00 -05:00
Nick Mathewson
c1d98c75e3 Merge branch 'maint-0.3.0' into maint-0.3.1 2018-01-03 08:59:59 -05:00
Nick Mathewson
bbc9ff160e Merge branch 'maint-0.2.9' into maint-0.3.0 2018-01-03 08:59:59 -05:00
Nick Mathewson
c9b3f6352f Merge branch 'bug24633_029' into maint-0.2.9 2018-01-03 08:59:52 -05:00
Nick Mathewson
fb5877b972 Merge branch 'maint-0.3.0' into maint-0.3.1 2018-01-02 10:10:28 -05:00
Nick Mathewson
8a7767603a Merge branch 'maint-0.2.9' into maint-0.3.0 2018-01-02 10:10:28 -05:00
Nick Mathewson
bc5ef83f8f Merge branch 'maint-0.3.2' 2018-01-02 10:10:28 -05:00
Nick Mathewson
707076002d Merge branch 'maint-0.3.1' into maint-0.3.2 2018-01-02 10:10:28 -05:00
Nick Mathewson
6e5e4f92ab Merge remote-tracking branch 'teor/bug24736_028' into maint-0.2.9 2018-01-02 10:09:44 -05:00
Nick Mathewson
d53f779853 Merge remote-tracking branch 'teor/ticket24001' 2018-01-02 10:07:13 -05:00
Nick Mathewson
996328f374 Remove changes file for 24762
(Bugfixes for bugs not in any released Tor don't get listed in the
changelog, and therefore don't need changes files.)
2018-01-02 09:55:32 -05:00
Nick Mathewson
2819e9467e Merge remote-tracking branch 'teor/bug24762' 2018-01-02 09:54:56 -05:00
Nick Mathewson
5051cfe9bd Merge remote-tracking branch 'ffmancera/github/bug24677' 2018-01-02 09:37:23 -05:00
Fernando Fernandez Mancera
525c1c493e Set IPv6 preferences for bridges even if there is no ri.
Tor now sets IPv6 preferences on rewrite_node_address_for_bridge() even if
there is only ri or rs. It always warns about them.

Also Tor now sets the IPv6 address in rs as well as it sets the one in ri.

Fixes #24572 on 9e9edf7 in 0.2.4.5-alpha.
Fixes #24573 on c213f27 in 0.2.8.2-alpha.

Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2018-01-02 15:28:15 +01:00
Fernando Fernandez Mancera
3871c102a6 Use ping -6 ::1 on Linux when ping6 ::1 fails on tests.
Tor test now checks if "ping -6 -c 1 -W 1 ::1" works when "ping6 -c 1 -W 1 ::1"
fails on tests.

Fixes #24677; bugfix in 0.2.9.3-alpha.

Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2018-01-02 15:18:36 +01:00
teor
e7029621db
Changes file for ticket 23966. 2017-12-30 18:14:33 +11:00
teor
d99ccf090f
Stop trying to remove NULL filenames on shutdown
Fixes bug 24762; bugfix on master.
(Not in any released version of Tor.)
2017-12-30 17:19:42 +11:00
teor
09b9a35c07
Clear the address when we can't choose a reachable address
When the fascist_firewall_choose_address_ functions don't find a
reachable address, set the returned address to the null address and port.

This is a precautionary measure, because some callers do not check the
return value.

Fixes bug 24736; bugfix on 0.2.8.2-alpha.
2017-12-25 01:55:28 +11:00
teor
53f350182e
Expand comments in node_get_ed25519_id() and put them near the relevant code
And add a changes file.

Follow-up to 24001.
2017-12-24 19:50:47 +11:00
teor
30e1371675
Make the default DirAuthorityFallbackRate 0.1
This makes clients on the public tor network prefer to bootstrap off fallback
directory mirrors.

This is a follow-up to 24679, which removed weights from the default fallbacks.

Implements ticket 24681.
2017-12-23 00:01:31 +11:00
Nick Mathewson
7b9e790956 remove changes files that appear in 0.3.2.8-rc 2017-12-21 12:41:25 -05:00
Nick Mathewson
2b8a06a2ef Merge branch 'maint-0.3.2' 2017-12-21 11:16:00 -05:00
Nick Mathewson
6cd567d797 Merge remote-tracking branch 'dgoulet/bug24671_032_01' into maint-0.3.2 2017-12-21 11:13:33 -05:00
Nick Mathewson
b8a3602b2a Merge branch 'maint-0.3.2' 2017-12-21 10:54:05 -05:00
Nick Mathewson
84adb9fcca Merge branch 'maint-0.3.1' into maint-0.3.2 2017-12-21 10:50:33 -05:00
Nick Mathewson
08469a338a Merge branch 'maint-0.3.0' into maint-0.3.1 2017-12-21 10:50:06 -05:00
Nick Mathewson
03b4dd92a4 Merge branch 'maint-0.2.9' into maint-0.3.0 2017-12-21 10:49:40 -05:00
Nick Mathewson
3b08184338 Merge branch 'maint-0.2.8' into maint-0.2.9 2017-12-21 10:43:12 -05:00
Nick Mathewson
7d845976e3 Merge branch 'maint-0.2.5' into maint-0.2.8 2017-12-21 10:43:06 -05:00
Nick Mathewson
9202087760 Merge branch 'bug24666_squashed_025' into maint-0.2.5 2017-12-21 10:40:10 -05:00
Nick Mathewson
520cf21793 Move destroy cells into a separate queue type of their own, to save RAM
We've been seeing problems with destroy cells queues taking up a
huge amount of RAM.  We can mitigate this, since while a full packed
destroy cell takes 514 bytes, we only need 5 bytes to remember a
circuit ID and a reason.

Fixes bug 24666. Bugfix on 0.2.5.1-alpha, when destroy cell queues
were introduced.
2017-12-21 10:29:01 -05:00
Nick Mathewson
d0c5fe257b Merge branch 'maint-0.3.2' 2017-12-21 10:20:35 -05:00
David Goulet
885ba513ff sched: Consider extra_space even if negative in KIST
With extra_space negative, it means that the "notsent" queue is quite large so
we must consider that value with the current computed tcp_space. If we end up
to have negative space, we should not add more data to the kernel since the
notsent queue is just too filled up.

Fixes #24665

Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-21 09:32:04 -05:00
David Goulet
fdfa4a5a14 sched: Use lower layer cell limit with KISTLite
Instead of using INT_MAX as a write limit for KISTLite, use the lower layer
limit which is using the specialized num_cells_writeable() of the channel that
will down the line check the connection's outbuf and limit it to 32KB
(OR_CONN_HIGHWATER).

That way we don't take the chance of bloating the connection's outbuf and we
keep the cells in the circuit queue which our OOM handler can take care of,
not the outbuf.

Finally, this commit adds a log_debug() in the update socket information
function of KIST so we can get the socket information in debug.

Fixes #24671

Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-20 14:17:18 -05:00
Fernando Fernandez Mancera
ac9eebd636 Add some values to OOM log msg #24501
Exposing cell_queues_get_total_allocation(), buf_get_total_allocation(),
tor_compress_get_total_allocation(), tor_compress_get_total_allocation() when
hit MaxMemInQueues threshold.

Fixes #24501

Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2017-12-20 18:31:30 +01:00
Nick Mathewson
5e92646715 Merge branch 'maint-0.3.0' into maint-0.3.1 2017-12-20 12:15:24 -05:00
Nick Mathewson
08ed0d7930 Merge branch 'maint-0.2.9' into maint-0.3.0 2017-12-20 12:15:24 -05:00
Nick Mathewson
7e45720cf4 Merge branch 'maint-0.3.1' into maint-0.3.2 2017-12-20 12:15:24 -05:00
Nick Mathewson
0e790bb40d Merge branch 'maint-0.3.2' 2017-12-20 12:15:24 -05:00
Nick Mathewson
c604a76a53 Merge branch 'maint-0.2.8' into maint-0.2.9 2017-12-20 12:15:23 -05:00
Nick Mathewson
877dd1d6c8 Merge branch 'maint-0.2.5' into maint-0.2.8 2017-12-20 12:15:23 -05:00
Karsten Loesing
428f8a375b Update geoip and geoip6 to the December 6 2017 database. 2017-12-20 17:36:29 +01:00
Nick Mathewson
7ca0a9c4ae Merge remote-tracking branch 'ahf-oniongit/bugs/24605' 2017-12-20 11:16:17 -05:00
Nick Mathewson
18543c2c9b Merge remote-tracking branch 'ffmancera/github/bug23271' 2017-12-20 10:40:32 -05:00
Nick Mathewson
83ced3e7fe Merge branch 'maint-0.3.2' 2017-12-20 09:59:51 -05:00
Nick Mathewson
fc33caadae Merge remote-tracking branch 'dgoulet/ticket24425_032_01' into maint-0.3.2 2017-12-20 09:59:06 -05:00
Nick Mathewson
accd0ea65b Fix the clz32 and clz64 settings on MSVC.
Fixes bug 24633; bugfix on 0.2.9.1-alpha.
2017-12-20 09:37:18 -05:00
Nick Mathewson
69a320ce5d Merge branch 'xfer_time_coarse' 2017-12-20 09:15:30 -05:00
Alexander Færøy
d4f4108601
Add MainloopStats option.
This patch adds support for MainloopStats that allow developers to get
main event loop statistics via Tor's heartbeat status messages. The new
status log message will show how many succesful, erroneous, and idle
event loop iterations we have had.

See: https://bugs.torproject.org/24605
2017-12-16 02:41:21 +01:00
Nick Mathewson
424572ee0a please lintchanges 2017-12-15 12:53:01 -05:00
Nick Mathewson
20f802ea3c Add an option to disable signal handler installation.
Closes ticket 24588.
2017-12-15 12:48:29 -05:00
Fernando Fernandez Mancera
61c721f145 Add remove file function and remove ephemeral files.
Adding tor_remove_file(filename) and refactoring tor_cleanup().

Removing CookieAuthFile and ExtORPortCookieAuthFile when tor_cleanup() is
called.

Fixes #23271.

Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2017-12-15 17:01:22 +01:00
Nick Mathewson
519c6ba26c Merge remote-tracking branch 'isis/bug24612' 2017-12-15 10:59:57 -05:00
Nick Mathewson
102b4f3a92 remove changes files that will appear in 0.3.2.7-rc 2017-12-13 12:08:52 -05:00
Nick Mathewson
8441189b3c Changes file for 24374, merged earlier. 2017-12-13 09:50:57 -05:00
Nick Mathewson
219c969d7b Use monotime_coarse for transfer times and padding times
Using absolute_msec requires a 64-bit division operation every time
we calculate it, which gets expensive on 32-bit architectures.
Instead, just use the lazy "monotime_coarse_get()" operation, and
don't convert to milliseconds until we absolutely must.

In this case, it seemed fine to use a full monotime_coarse_t rather
than a truncated "stamp" as we did to solve this problem for the
timerstamps in buf_t and packed_cell_t: There are vastly more cells
and buffer chunks than there are channels, and using 16 bytes per
channel in the worst case is not a big deal.

There are still more millisecond operations here than strictly
necessary; let's see any divisions show up in profiles.
2017-12-13 09:46:58 -05:00
Isis Lovecruft
c7dc65e033
build: Add pretty printing of results of rust autoconf checks.
* ADDS several `AC_MSG_RESULT`s which print the result of our checks
   for our rust dependencies and a check for a suitable rustc compiler
   version.
 * FIXES #24612: https://bugs.torproject.org/24612
2017-12-13 02:27:02 +00:00
Nick Mathewson
426110dfa2 Merge branch 'maint-0.3.2' 2017-12-12 19:46:53 -05:00
Nick Mathewson
15b41fa6ae Make sandbox.c compile when libseccomp-dev is installed on arm64
Fixes ticket 24424.  Patch from weasel.
2017-12-12 19:46:03 -05:00
Nick Mathewson
9abef516f6 Merge branch 'maint-0.3.2' 2017-12-12 19:27:14 -05:00
Nick Mathewson
bf89b08930 Merge branch 'bug24367_032_squashed' into maint-0.3.2 2017-12-12 19:17:38 -05:00
teor
19a4abf2a9 Make sure bridges are definitely running before delaying directory fetches
Retry directory downloads when we get our first bridge descriptor
during bootstrap or while reconnecting to the network. Keep retrying
every time we get a bridge descriptor, until we have a reachable bridge.

Stop delaying bridge descriptor fetches when we have cached bridge
descriptors. Instead, only delay bridge descriptor fetches when we
have at least one reachable bridge.

Fixes bug 24367; bugfix on 0.2.0.3-alpha.
2017-12-12 19:17:25 -05:00
Nick Mathewson
e622f208a3 Merge remote-tracking branch 'teor/bug23827-v2' 2017-12-12 09:27:03 -05:00
Nick Mathewson
6c5a73f87a Merge remote-tracking branch 'ahf-oniongit/bugs/24362' 2017-12-12 09:18:52 -05:00
Nick Mathewson
31ce03a2b9 Merge branch 'maint-0.3.0' into maint-0.3.1 2017-12-12 09:13:12 -05:00
Nick Mathewson
4c54021baf Merge branch 'maint-0.3.1' into maint-0.3.2 2017-12-12 09:13:12 -05:00
Nick Mathewson
644ec835d5 Merge branch 'maint-0.3.2' 2017-12-12 09:13:12 -05:00
Nick Mathewson
d3b7a2bd27 rename changes file 2017-12-12 09:13:05 -05:00
Nick Mathewson
eecfed0cd2 Merge branch 'maint-0.2.8' into maint-0.2.9 2017-12-11 16:56:31 -05:00
Nick Mathewson
f7151387d9 Merge branch 'maint-0.2.5' into maint-0.2.8 2017-12-11 16:56:31 -05:00
Nick Mathewson
cdee62da9e Merge branch 'maint-0.3.0' into maint-0.3.1 2017-12-11 16:56:31 -05:00
Nick Mathewson
da38904efb Merge branch 'maint-0.2.9' into maint-0.3.0 2017-12-11 16:56:31 -05:00
Nick Mathewson
1deda2106b Merge branch 'bug24167_025' into maint-0.2.5 2017-12-11 16:56:28 -05:00
Nick Mathewson
eaaa1108a3 Merge branch 'maint-0.2.8' into maint-0.2.9 2017-12-11 16:54:14 -05:00
Nick Mathewson
04524443d0 Merge branch 'maint-0.3.0' into maint-0.3.1 2017-12-11 16:54:14 -05:00
Nick Mathewson
2ea573ece8 Merge branch 'maint-0.2.9' into maint-0.3.0 2017-12-11 16:54:14 -05:00
Nick Mathewson
bc1ea4f470 Merge branch 'maint-0.2.5' into maint-0.2.8 2017-12-11 16:54:11 -05:00
Nick Mathewson
f5d4bdf305 Merge remote-tracking branch 'public/ticket23856_025_01' into maint-0.2.5 2017-12-11 16:53:02 -05:00
Nick Mathewson
736e7299ce Merge branch 'maint-0.3.0' into maint-0.3.1 2017-12-11 16:51:58 -05:00
Nick Mathewson
7fcb222ab7 Merge branch 'maint-0.2.9' into maint-0.3.0 2017-12-11 16:51:58 -05:00
Nick Mathewson
7e486dd6f7 Merge remote-tracking branch 'public/bug23985_029' into maint-0.2.9 2017-12-11 16:51:54 -05:00
Nick Mathewson
f7b41bcdf0 Merge branch 'bug24086_031' into maint-0.3.1 2017-12-11 16:49:01 -05:00
Nick Mathewson
828333e38c Merge remote-tracking branch 'public/bug24099_031' into maint-0.3.1 2017-12-11 16:48:44 -05:00
Nick Mathewson
d2031f2c60 Merge remote-tracking branch 'public/bug23817_031' into maint-0.3.1 2017-12-11 16:45:54 -05:00
Nick Mathewson
d5400d50e7 Merge branch 'maint-0.3.2' 2017-12-11 16:43:51 -05:00
Nick Mathewson
acc462c965 Merge branch 'maint-0.3.1' into maint-0.3.2 2017-12-11 16:43:48 -05:00
Nick Mathewson
ae608408e9 Merge remote-tracking branch 'asn/bug23862_031' into maint-0.3.1 2017-12-11 16:43:41 -05:00
Nick Mathewson
c55a054236 Merge remote-tracking branch 'asn/bug23862_030' into maint-0.3.0 2017-12-11 16:41:28 -05:00
Nick Mathewson
418d8bbe92 Merge branch 'stack_fixes_032_v2' into maint-0.3.2 2017-12-11 16:25:04 -05:00
Nick Mathewson
35d56a127d Add a changelog for the STACK fixes 2017-12-11 16:23:11 -05:00
Nick Mathewson
252db6ad26 Merge branch 'maint-0.3.2' 2017-12-11 16:02:10 -05:00
David Goulet
057139d383 sched: Avoid integer overflow when computing tcp_space
In KIST, we could have a small congestion window value than the unacked
packets leading to a integer overflow which leaves the tcp_space value to be
humongous.

This has no security implications but it results in KIST scheduler allowing to
send cells on a potentially saturated connection.

Found by #24423. Fixes #24590.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-11 15:45:19 -05:00
Nick Mathewson
f205dabf7a Stop using event_base_once().
This function leaks memory when the event_base is freed before the
event itself fires.  That's not harmful, but it's annoying when
trying to debug other memory leaks.

Fixes bug 24584; bugfix on 0.2.8.1-alpha.
2017-12-11 12:23:02 -05:00
Nick Mathewson
3b465ebf2e Changes file and tor_api.h tweaks for 24581. 2017-12-11 11:55:41 -05:00
Nick Mathewson
e18840f619 Fix the log-severities memory-leak in tor-resolve.c
Also, rename the variable to have a more manageable name, and make
its scope more clear.

Fixes bug 24582; bugfix on 0.2.1.1-alpha.
2017-12-11 11:49:57 -05:00
Matt Traudt
d4c7bd98ac Add changes file for 24531 2017-12-11 10:30:37 -05:00
Nick Mathewson
ea929e8456 Merge remote-tracking branch 'public/feature24427' 2017-12-11 09:59:46 -05:00
Nick Mathewson
7803b19c43 Merge remote-tracking branch 'ffmancera/github/bug23459' 2017-12-11 09:53:39 -05:00
Nick Mathewson
98682f689b Merge branch 'maint-0.3.2' 2017-12-11 09:45:17 -05:00
Nick Mathewson
d68abbe358 Merge remote-tracking branch 'dgoulet/bug23603_032_02' into maint-0.3.2 2017-12-11 09:42:12 -05:00
Alexander Færøy
b0b8f7c30c Add support for Android's logging subsystem.
This patch adds support for Android's logging subsystem in Tor. When
debugging Android applications it is useful to be able to collect
information about the application running on the platform via the
various system services that is available on the platform.

This patch allows you to add "Log notice android" to your torrc and have
Tor send everything above and including the notice severity to Android's
ring buffer which can be inspected using the 'adb logcat' program.

See: https://bugs.torproject.org/24362
2017-12-11 13:22:39 +00:00
teor
94ad47e332
fixup! Stop waiting for microdescs if the consensus supports IPv6 ORPorts 2017-12-11 00:53:49 +11:00
teor
bbc781885d
fixup! Add networkstatus_consensus_has_ipv6() and unit tests
This is what happens when you don't run:
make check-spaces
make check-changes
2017-12-11 00:53:03 +11:00
teor
b66b62fb75
Stop waiting for microdescs if the consensus supports IPv6 ORPorts
Also make IPv6-only clients wait for microdescs for relays, even if we were
previously using descriptors (or were using them as a bridge) and have
a cached descriptor for them.

But if node_is_a_configured_bridge(), stop waiting for its IPv6 address in
a microdescriptor, because we'll never use it.

Implements #23827.
2017-12-11 00:34:31 +11:00
Nick Mathewson
0340c02975 Merge remote-tracking branch 'mikeperry/bug23114_squashed2' 2017-12-08 17:50:34 -05:00
Nick Mathewson
5ee0cccd49 Merge branch 'macro_free_v2_squashed' 2017-12-08 14:58:43 -05:00
Nick Mathewson
5508ee29d5 changes file for big free macro-ization branch 2017-12-08 14:47:19 -05:00
Nick Mathewson
44010c6fc1 Merge branch 'dgoulet_ticket23709_033_01_squashed' 2017-12-08 14:44:09 -05:00
David Goulet
50124fd7a6 chan: Add changes file for ticket 23709
Closes #23709

Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-08 14:43:27 -05:00
Fernando Fernandez Mancera
8559827280 Split client-side get_rend_circ into two functions.
Split hs_circuitmap_get_rend_circ_client_side(). One returns only established
circuits (hs_circuitmap_get_established_rend_circ_client_side()) and the other
returns all kinds of circuits.

Fixes #23459

Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2017-12-08 18:14:08 +01:00
Nick Mathewson
021fdd39e4 Use mach_approximate_time() for coarse time where available.
This lets us have a coarse-time implementation with reasonable
performance characteristics on OSX and iOS.

Implements 24427.
2017-12-08 09:24:02 -05:00
Nick Mathewson
45b9b2245f Merge branch 'maint-0.3.2' 2017-12-07 08:42:56 -05:00
Nick Mathewson
4b41ffa64d Merge branch 'arthuredelstein_18859+1_031' into maint-0.3.2 2017-12-07 08:42:49 -05:00
Nick Mathewson
13049a9866 Rewrite 18859 changes file from user POV. 2017-12-07 08:41:00 -05:00
Mike Perry
ed89588c4f Bug #23114: Time out circuits immediately.
This changes the purpose of circuits that are past the timeout to measurement
*as they are built*, ensuring accurate application of the timeout logic.
2017-12-07 00:04:38 +00:00
Mike Perry
b5d4cd1b41 Bug #23100: Count all 3 hop circuits for CBT.
This change causes us to count anything once it reaches 3 hops (but not
after).
2017-12-07 00:04:33 +00:00
Arthur Edelstein
2bd91dbd34 Don't consider a port "handled" by an isolated circuit.
Previously, circuit_stream_is_being_handled incorrectly reported
that (1) an exit port was "handled" by a circuit regardless of
whether the circuit was already isolated in some way, and
(2) that a stream could be "handled" by a circuit even if their
isolation settings were incompatible.

As a result of (1), in Tor Browser, circuit_get_unhandled_ports was
reporting that all ports were handled even though all non-internal
circuits had already been isolated by a SOCKS username+password.

Therefore, circuit_predict_and_launch_new was declining to launch
new exit circuits. Then, when the user visited a new site in Tor
Browser, a stream with new SOCKS credentials would be initiated,
and the stream would have to wait while a new circuit with those
credentials could be built. That wait was making the
time-to-first-byte longer than it needed to be.

Now, clean, not-yet-isolated circuit(s) will be automatically
launched ahead of time and be ready for use whenever a new stream
with new SOCKS credentials (or other isolation criteria) is
initiated.

Fixes bug 18859. Thanks to Nick Mathewson for improvements.
2017-12-06 14:18:41 -08:00
Nick Mathewson
c470a6d278 Merge remote-tracking branch 'teor/bug24488' 2017-12-06 14:44:03 -05:00
Nick Mathewson
d4ca18573c Merge remote-tracking branch 'dgoulet/bug24502_032_01' into maint-0.3.2 2017-12-06 14:37:53 -05:00
Nick Mathewson
91f72bbb6c Merge remote-tracking branch 'teor/bug24489' 2017-12-06 14:37:15 -05:00
Nick Mathewson
aa6212a858 Merge remote-tracking branch 'dgoulet/bug24502_032_01' 2017-12-06 14:31:33 -05:00
Nick Mathewson
a7a0cebb59 Merge branch 'more_directories_squashed' 2017-12-05 19:49:45 -05:00
Nick Mathewson
46f167886a add a changes file 2017-12-05 19:49:29 -05:00
Nick Mathewson
e8a6a6635b Merge branch 'dgoulet_ticket20699_033_01' 2017-12-05 19:43:23 -05:00
David Goulet
5d4fc193f9 control: Add changes file for HSv3 control port
Part of #20699.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-05 19:39:46 -05:00
Nick Mathewson
1969d57363 Change our build process to run Cargo from inside the build tree
Instead of using the cwd to specify the location of Cargo.toml, we
use the --manifest-path option to specify its location explicitly.

This works around the bug that isis diagnosed on our jenkins builds.
2017-12-05 14:23:55 -05:00
Nick Mathewson
a798ba6e9b Merge branch 'maint-0.3.2' 2017-12-05 12:10:06 -05:00
Nick Mathewson
779e4b9dcf Tweaks to strings in 24500 2017-12-05 12:09:57 -05:00
Fernando Fernandez Mancera
313360e6e6 Make errno error log more useful for getrandom()
Making errno error log more useful for getrandom() call. Adding if statement to
make difference between ENOSYS and other errors.

Fixes #24500

Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2017-12-05 12:05:09 -05:00
David Goulet
e80893e51b hs-v3: Cleanup HS circuits when marking as closed
First, hs_service_intro_circ_has_closed() is now called in circuit_mark_for
close() because the HS subsystem needs to learn when an intro point is
actually not established anymore as soon as possible. There is a time window
between a close and a free.

Second, when we mark for close, we also remove it from the circuitmap because
between the close and the free, a service can launch an new circuit to that
same intro point and thus register it which only succeeds if the intro point
authentication key is not already in the map.

However, we still do a remove from the circuitmap in circuit_free() in order
to also cleanup the circuit if it wasn't marked for close prior to the free.

Fixes #23603

Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-05 10:55:41 -05:00
David Goulet
97702c69b0 sched: Set channel scheduler state to IDLE when not opened
In the KIST main loop, if the channel happens to be not opened, set its state
to IDLE so we can release it properly later on. Prior to this fix, the channel
was in PENDING state, removed from the channel pending list and then kept in
that state because it is not opened.

This bug was introduced in commit dcabf801e5 for
which we made the scheduler loop not consider unopened channel.

This has no consequences on tor except for an annoying but harmless BUG()
warning.

Fixes #24502

Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-04 14:48:15 -05:00
Nick Mathewson
0694a6dc01 Don't pass --quiet to cargo for now
Fixes bug 24518.
2017-12-04 14:19:22 -05:00
Nick Mathewson
ff0db77f91 Merge remote-tracking branch 'isis/bug22907' 2017-12-04 14:12:03 -05:00
Nick Mathewson
fcefd69b80 Merge branch 'maint-0.3.2' 2017-12-04 14:01:55 -05:00
Nick Mathewson
a5be2305e1 fix check-changes warning 2017-12-04 14:01:52 -05:00
Nick Mathewson
70b19894ae Merge branch 'maint-0.3.2' 2017-12-04 13:23:52 -05:00
David Goulet
ff6c8cf861 sched: Downgrade warning log to info in KIST
Some platforms don't have good monotonic time support so don't warn when the
diff between the last run of the scheduler time and now is negative. The
scheduler recovers properly from this so no need to be noisy.

Fixes #23696

Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-04 12:22:02 -05:00
Nick Mathewson
f50d64b62e Merge branch 'bug23826-23828_squashed' 2017-12-04 11:43:11 -05:00
teor
a2c09f6751 Changes file for #23826, #23828, and #23870 2017-12-04 11:42:56 -05:00
teor
9acfd70f26
Sprinkle some consts in networkstatus_getinfo_by_purpose()
And note where we change the running flag, but probably shouldn't.

Implements ticket 24489.
2017-12-02 21:21:41 +11:00
teor
f1a5000b98
Make set_routerstatus_from_routerinfo() set IPv6 unspecified addresses
When creating a routerstatus (vote) from a routerinfo (descriptor),
set the IPv6 address to the unspecified IPv6 address, and explicitly
initialise the port to zero.

Also clarify the documentation for the function.

Fixes bug 24488; bugfix on 0.2.4.1-alpha.
2017-12-02 21:00:22 +11:00
Nick Mathewson
953a8f8510 Merge branch 'maint-0.2.8' into maint-0.2.9 2017-12-01 12:13:40 -05:00
Nick Mathewson
5c03bb7c0c Merge branch 'maint-0.3.0' into maint-0.3.1 2017-12-01 12:13:40 -05:00
Nick Mathewson
3bca705c54 Merge branch 'maint-0.2.9' into maint-0.3.0 2017-12-01 12:13:40 -05:00
Nick Mathewson
b86c9acac3 Merge branch 'maint-0.3.1' into maint-0.3.2 2017-12-01 12:13:40 -05:00
Nick Mathewson
cf3da63b90 Merge branch 'maint-0.3.2' 2017-12-01 12:13:40 -05:00
Nick Mathewson
f97f301b5b Merge branch 'maint-0.2.5' into maint-0.2.8 2017-12-01 12:13:39 -05:00
Nick Mathewson
461e34bb3d Fix a clang compilation warning in rendservice.c
Fixes bug 24480; bugfix on 0.2.5.16.
2017-12-01 12:13:15 -05:00
George Kadianakis
7ae9e92ffb Add changes file for #23862. 2017-12-01 14:14:01 +02:00
George Kadianakis
43c34dfca0 Add changes file for #23862. 2017-12-01 14:06:36 +02:00
Nick Mathewson
699899cbff remove changes files that are going into 0.3.2.6-alpha or earlier. 2017-11-30 12:31:23 -05:00
Nick Mathewson
cef844d017 Merge branch 'maint-0.3.2' 2017-11-30 12:07:59 -05:00
Nick Mathewson
fd73a168ca Merge branch 'maint-0.3.1' into maint-0.3.2 2017-11-30 12:07:59 -05:00
Nick Mathewson
ee48eb1eb5 Merge branch 'maint-0.3.0' into maint-0.3.1 2017-11-30 12:07:59 -05:00
Nick Mathewson
5fc0587c04 Merge branch 'maint-0.2.9' into maint-0.3.0 2017-11-30 12:07:59 -05:00
Nick Mathewson
7e2b012b46 Merge branch 'maint-0.2.8' into maint-0.2.9 2017-11-30 12:07:59 -05:00
Nick Mathewson
ba4a9cf0c0 Merge branch 'maint-0.2.5' into maint-0.2.8 2017-11-30 12:07:59 -05:00
Nick Mathewson
d459c08b7d Merge branch 'trove-2017-012_030' into maint-0.3.0 2017-11-30 12:07:43 -05:00
Nick Mathewson
52d7af631c Merge branch 'trove-2017-010_029' into maint-0.2.9 2017-11-30 12:07:26 -05:00
Nick Mathewson
f49876d66e Merge branch 'trove-2017-012_025' into maint-0.2.5 2017-11-30 12:06:21 -05:00
Nick Mathewson
08ce39fb0f Merge branch 'trove-2017-011_025' into maint-0.2.5 2017-11-30 12:06:17 -05:00
Nick Mathewson
a6a0c7a4ec Merge branch 'trove-2017-009_025' into maint-0.2.5 2017-11-30 12:05:59 -05:00
Nick Mathewson
75509dc827 Fix changes file 2017-11-30 11:52:40 -05:00
Nick Mathewson
766d0a2d98 Merge branch 'maint-0.2.9' into maint-0.3.0 2017-11-30 11:48:12 -05:00
Nick Mathewson
500f04a74e Merge branch 'maint-0.3.0' into maint-0.3.1 2017-11-30 11:48:12 -05:00
Nick Mathewson
072e194a15 Merge branch 'bug21394_029' into maint-0.2.9 2017-11-30 11:48:06 -05:00
Nick Mathewson
1c7121be54 Merge branch 'bug24119_squashed' 2017-11-30 08:00:34 -05:00
Alex Xu (Hello71)
49a4961dad Add changes/bug24119 2017-11-30 08:00:24 -05:00
Fernando Fernandez Mancera
bef461ef1f Switch -Wnormalized=id to -Wnormalized=nfkc
Modified -Wnormalized flag to nfkc option in configure.ac to avoid source code
identifier confusion.

Fixes #24467

Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2017-11-29 20:29:55 -05:00
Nick Mathewson
27f017639f Merge branch 'ticket20020' 2017-11-29 20:24:34 -05:00
Nick Mathewson
6a9c3d6e3a Merge branch 'maint-0.3.2' 2017-11-29 12:02:44 -05:00
Nick Mathewson
9b44bb49b4 Merge branch 'bug24050_029_squashed' into maint-0.3.2 2017-11-29 12:02:07 -05:00
Nick Mathewson
a94c486102 Make the cache_ipv4_answers default become 0 again, for real.
Fortunately, use_cached_ipv4_answers was already 0, so we wouldn't
actually use this info, but it's best not to have it.

Fixes bug 24050; bugfix on 0.2.6.3-alpha
2017-11-29 12:01:45 -05:00
David Goulet
7bb269548d hs-v3: Bump hsdir_spread_store from 3 to 4
Per the analysis in
https://trac.torproject.org/projects/tor/ticket/23170#comment:17, this will
greatly improve service reachability.

Closes #24425

Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-11-29 09:19:02 -05:00
David Goulet
6ab07419c8 Use local descriptor object to exclude self in path selection
TROVE-2017-12. Severity: Medium

When choosing a random node for a circuit, directly use our router
descriptor to exclude ourself instead of the one in the global
descriptor list. That list could be empty because tor could be
downloading them which could lead to not excluding ourself.

Closes #21534
2017-11-28 19:14:10 -05:00
David Goulet
91cee3c9e7 Guard: Don't pick ourselves as a possible Guard
TROVE-2017-12. Severity: Medium

Thankfully, tor will close any circuits that we try to extend to
ourselves so this is not problematic but annoying.

Part of #21534.
2017-11-28 19:12:56 -05:00
David Goulet
3030741b5d hs-v2: Remove any expiring intro from the retry list
TROVE-2017-13. Severity: High.

In the unlikely case that a hidden service could be missing intro circuit(s),
that it didn't have enough directory information to open new circuits and that
an intro point was about to expire, a use-after-free is possible because of
the intro point object being both in the retry list and expiring list at the
same time.

The intro object would get freed after the circuit failed to open and then
access a second time when cleaned up from the expiring list.

Fixes #24313
2017-11-28 18:41:29 -05:00
Isis Lovecruft
bb4993395c
doc: Document how to build with Rust dependencies in offline-mode.
* CLOSES #22907: https://bugs.torproject.org/22907
2017-11-28 22:39:55 +00:00
Nick Mathewson
1880a6a88e Avoid asking for passphrase on junky PEM input
Fixes bug 24246 and TROVE-2017-011.

This bug is so old, it's in Matej's code.  Seems to have been
introduced with e01522bbed.
2017-11-27 15:25:03 -05:00
Nick Mathewson
2c0487ecfb Handle NULL input to protover_compute_for_old_tor()
Fixes bug 24245; bugfix on 0.2.9.4-alpha. TROVE-2017-010.
2017-11-27 15:16:30 -05:00
Nick Mathewson
2834cc9c18 Fix length of replaycache-checked data.
This is a regression; we should have been checking only the
public-key encrypted portion.  Fixes bug 24244, TROVE-2017-009, and
CVE-2017-8819.
2017-11-27 15:12:19 -05:00
Nick Mathewson
b230860608 Merge branch 'maint-0.3.2' 2017-11-27 10:04:16 -05:00
Nick Mathewson
ef54610442 Merge branch 'ticket23856_025_01' into maint-0.3.2 2017-11-27 10:02:03 -05:00
David Goulet
8be50ca3ea relay: Change bandwidth stats interval to 24 hours
Going from 4 hours to 24 hours in order to try reduce the efficiency of guard
discovery attacks.

Closes #23856

Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-11-27 10:00:40 -05:00
Nick Mathewson
b1c4ab0bec Merge branch 'maint-0.2.9' into maint-0.3.0 2017-11-27 09:09:34 -05:00
Nick Mathewson
703ab95e9f Merge branch 'maint-0.3.0' into maint-0.3.1 2017-11-27 09:09:34 -05:00
Nick Mathewson
30b3229252 Merge branch 'maint-0.2.8' into maint-0.2.9 2017-11-27 09:09:34 -05:00
Nick Mathewson
722c64fc23 Merge branch 'maint-0.3.2' 2017-11-27 09:09:34 -05:00
Nick Mathewson
4bb287aa39 Merge branch 'maint-0.3.1' into maint-0.3.2 2017-11-27 09:09:34 -05:00
Sebastian Hahn
25c90230be Add bastet's ipv6 address
Implements ticket 24394
2017-11-27 09:09:16 -05:00
Nick Mathewson
5da0a73838 Merge branch 'ticket23953_033_squashed' 2017-11-21 14:06:57 -05:00
Nick Mathewson
25f882a9cf Use stdatomic.h for atomic_counter_t where available.
Closes ticket 23953.
2017-11-21 14:06:48 -05:00
Nick Mathewson
1cc344b277 Merge remote-tracking branch 'teor/bug23760_nc' 2017-11-21 13:56:57 -05:00
Nick Mathewson
add37440fa changes file for 24318 2017-11-21 13:55:11 -05:00
Fernando Fernandez Mancera
edc3fe0eb5 Remove /usr/athena from search path in configure.ac
Fixes #24363

Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2017-11-21 13:53:26 -05:00
Nick Mathewson
517032b8ce Merge branch 'maint-0.3.2' 2017-11-21 12:41:39 -05:00
Nick Mathewson
ba94dc28e8 Merge branches 'bug24099_031' and 'bug24086_031' into maint-0.3.2 2017-11-21 12:37:46 -05:00
Neel Chauhan
83b8034a98
Introduce node_get_curve25519_onion_key() in extend_info_from_node() 2017-11-22 02:20:54 +11:00
teor
690f646bf8
Stop checking cached bridge descriptors for usable bridges
Stop checking for bridge descriptors when we actually want to know if
any bridges are usable. This avoids potential bootstrapping issues.
Fixes bug 24367; bugfix on 0.2.0.3-alpha.

Stop stalling when bridges are changed at runtime. Stop stalling when
old bridge descriptors are cached, but they are not in use.
Fixes bug 24367; bugfix on 23347 in 0.3.2.1-alpha.
2017-11-22 02:00:34 +11:00
Nick Mathewson
9068e55ce8 Merge branch 'maint-0.3.2' 2017-11-20 14:25:17 -05:00
Nick Mathewson
1bf36c1837 Include ws2_32 when trying to link openssl on windows in autoconf
Fixes bug 23783; bugfix on 0.3.2.2-alpha when we started looking for
TLSv1_1_method().
2017-11-20 13:37:22 -05:00
Nick Mathewson
729f9a286c Merge branch 'maint-0.3.2' 2017-11-20 13:22:10 -05:00
Nick Mathewson
846df5b3cd Merge remote-tracking branches 'public/ticket24315_029' and 'public/bug24198_029' into maint-0.3.2 2017-11-20 13:20:25 -05:00
Nick Mathewson
3bb29dd707 Correctly handle partial success in consensus diff calculation.
Previously, if store_multiple() reported a partial success, we would
store all the handles it gave us as if they had succeeded.  But it's
possible for the diff to be only partially successful -- for
example, if LZMA failed but the other compressors succeeded.

Fixes bug 24086; bugfix on 0.3.1.1-alpha.
2017-11-20 11:04:37 -05:00
Nick Mathewson
c8ee12b2e8 Recover better from empty/invalid storagedir files
If we can't read a file because of an FS issue, we say "we can't
read that" and move on.  But if we can't read it because it's empty,
because it has no labels, or because its labels are misformatted, we
should remove it.

Fixes bug 24099; bugfix on 0.3.1.1-alpha.
2017-11-20 10:14:41 -05:00
Nick Mathewson
04812e59df Merge branch 'maint-0.3.2' 2017-11-20 08:39:39 -05:00
Nick Mathewson
e0f7a2dbd4 Merge branch 'bug23681_029_01_squashed' into maint-0.3.2 2017-11-20 08:39:34 -05:00
David Goulet
981bb60575 circuit: Don't timeout opened C_INTRODUCING circuit
A circuit with purpose C_INTRODUCING means that its state is opened but the
INTRODUCE1 cell hasn't been sent yet. We shouldn't consider that circuit when
looking for timing out "building circuit". We have to wait on the rendezvous
circuit to be opened before sending that cell so the intro circuit needs to be
kept alive for at least that period of time.

This patch makes that the purpose C_INTRODUCING is ignored in the
circuit_expire_building() which means that we let the circuit idle timeout
take care of it if we end up never using it.

Fixes #23681

Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-11-20 08:33:44 -05:00
Nick Mathewson
2e590bac97 Remove changes files that have already been merged in 0.3.2.x 2017-11-18 11:23:41 -05:00
Nick Mathewson
7358559524 Merge branch 'maint-0.3.0' into maint-0.3.1 2017-11-18 11:02:42 -05:00
Nick Mathewson
2d849716df Merge branch 'maint-0.2.9' into maint-0.3.0 2017-11-18 11:02:08 -05:00
Nick Mathewson
53c3174ee4 Merge branch 'maint-0.2.8' into maint-0.2.9 2017-11-18 11:01:43 -05:00
Nick Mathewson
d388f9d879 Merge branch 'maint-0.2.5' into maint-0.2.8 2017-11-18 11:01:33 -05:00
Nick Mathewson
b9bce4288e Merge branch 'maint-0.3.2' 2017-11-18 10:23:52 -05:00
Nick Mathewson
a5b8b55c1c Fix memory leak in unit test for bridge distribution config.
Also, check for the actual message, and fix some string confusion,
while we're at it.

Fixes bug 24345; bugfix on 0.3.2.3-alpha.
2017-11-18 10:22:14 -05:00
Nick Mathewson
fcdec00685 Merge branch 'maint-0.3.2' 2017-11-17 09:59:26 -05:00
Nick Mathewson
2cee26b164 Merge branch 'bug23817_031' into maint-0.3.2 2017-11-17 09:56:53 -05:00
George Kadianakis
f61e3090fb Introduce new guard restriction and use it to skip outdated dirs. 2017-11-17 09:52:40 -05:00
Nick Mathewson
94dce246ee Merge branch 'maint-0.3.2' 2017-11-17 09:26:11 -05:00
Matt Traudt
b98614f1af Only log about lost KIST support once 2017-11-17 09:25:47 -05:00
Matt Traudt
8b2c01a46f Use less jargon in Scheduler sec. of man page 2017-11-17 09:25:07 -05:00
Matt Traudt
3537f7801d Add notes about OS support for our scheduler types 2017-11-17 09:25:01 -05:00
Nick Mathewson
cfacd44240 Merge branch 'maint-0.3.2' 2017-11-17 09:23:07 -05:00
Nick Mathewson
85778dc92d Merge remote-tracking branch 'dgoulet/bug23861_032_01' into maint-0.3.2 2017-11-17 09:23:04 -05:00
Nick Mathewson
368dc1003e Merge branch 'maint-0.3.2' 2017-11-17 08:35:56 -05:00
Nick Mathewson
3a364309ac Merge branch 'bug24167_025' into maint-0.3.2 2017-11-17 08:35:52 -05:00
Nick Mathewson
4ef70ff389 Merge branch 'maint-0.3.2' 2017-11-17 08:35:04 -05:00
Nick Mathewson
0571015819 Merge branch 'ticket24097_032' into maint-0.3.2 2017-11-17 08:35:01 -05:00
Nick Mathewson
4b56df9874 Merge branch 'maint-0.3.2' 2017-11-17 08:34:23 -05:00
Nick Mathewson
0684e6c6f0 Merge branch 'bug20963_032' into maint-0.3.2 2017-11-17 08:34:05 -05:00
Nick Mathewson
80bf270404 Add a changes file. 2017-11-16 14:07:58 -05:00
Nick Mathewson
7461cd3067 Permit kill(pid, 0) in the seccomp2 sandbox.
We don't want to allow general signals to be sent, but there's no
problem sending a kill(0) to probe whether a process is there.

Fixes bug 24198; bugfix on 0.2.5.1-alpha when the seccomp2 sandbox
was introduced.
2017-11-16 12:44:47 -05:00
Nick Mathewson
95238eb917 Fix a traceback when closing a blocked connection "immediately".
When we close a connection via connection_close_immediately, we kill
its events immediately. But if it had been blocked on bandwidth
read/write, we could try to re-add its (nonexistent) events later
from connection_bucket_refill -- if we got to that callback before
we swept the marked connections.

Fixes bug 24167.  Fortunately, this hasn't been a crash bug since we
introduced connection_check_event in 0.2.9.10, and backported it.

This is a bugfix on commit 89d422914a, I believe, which
appeared in Tor 0.1.0.1-rc.
2017-11-16 12:05:56 -05:00
David Goulet
380a95116a relay: Avoid extra LOG_NOTICE for every new descriptor batch
Commit 56c5e282a7 suppressed that same log
statement in directory_info_has_arrived() for microdescriptors so do the same
for the descriptors. As the commit says, we already have the bootstrap
progress for this.

Fixes #23861

Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-11-16 10:57:05 -05:00
Nick Mathewson
2a98fcb848 Downgrade evdns warnings about weird replies.
evdns is allowed to give us unrecognized object types; it is allowed
to give us non-IPv4 answer types, and it is (even) allowed to give
us empty answers without an error.

Closes ticket 24097.
2017-11-16 09:30:19 -05:00
Nick Mathewson
93dbce4ddd Log a better message if a router we're re-adding is expired.
Addresses ticket 20020.
2017-11-16 08:35:06 -05:00
Nick Mathewson
8ff60b5288 Merge branch 'maint-0.3.2' 2017-11-15 15:11:30 -05:00
Nick Mathewson
56b7407a90 Merge branch 'bug24279_030' into maint-0.3.2 2017-11-15 15:11:26 -05:00
Nick Mathewson
7548805850 whoops; add missing credit. 2017-11-15 15:11:15 -05:00
Nick Mathewson
67c62394bc Merge branch 'bug24279_030' into maint-0.3.2 2017-11-15 15:09:33 -05:00
Nick Mathewson
f28559fd2a Changes file for 24279. 2017-11-15 15:09:11 -05:00
Nick Mathewson
ef55a7a69a Tweak the message when we re-enable CBT.
Implements ticket 20963.
2017-11-15 14:42:59 -05:00