]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
7 years agorust: Add macro for passing static borrowed strings from Rust to C.
Isis Lovecruft [Thu, 8 Feb 2018 20:06:19 +0000 (20:06 +0000)] 
rust: Add macro for passing static borrowed strings from Rust to C.

 * ADD a new macro, tor_util::string::cstr!() which takes Rust strings,
   concatenates them together, appends a NUL byte, and converts it into a
   std::ffi::CStr for handing to C.

7 years agorust: Replace two `unwrap()`s in FFI code with `unwrap_or()`s.
Isis Lovecruft [Sat, 10 Feb 2018 01:21:31 +0000 (01:21 +0000)] 
rust: Replace two `unwrap()`s in FFI code with `unwrap_or()`s.

7 years agoMerge remote-tracking branch 'frewsxcv/frewsxcv-protover'
Nick Mathewson [Thu, 8 Feb 2018 22:45:17 +0000 (17:45 -0500)] 
Merge remote-tracking branch 'frewsxcv/frewsxcv-protover'

7 years agoStop claiming that compute_for_old_tor() returns pairs
Nick Mathewson [Thu, 8 Feb 2018 22:36:08 +0000 (17:36 -0500)] 
Stop claiming that compute_for_old_tor() returns pairs

7 years agoRemove new unsafe {} use.
Nick Mathewson [Thu, 8 Feb 2018 22:26:26 +0000 (17:26 -0500)] 
Remove new unsafe {} use.

Rationale: this helps for performance only, but we don't actually
have any reason to think that the checks here are
performance-critical.  Let's not normalize the use of unsafe {}.

7 years agoMerge remote-tracking branch 'isis/bug25127'
Nick Mathewson [Thu, 8 Feb 2018 22:16:14 +0000 (17:16 -0500)] 
Merge remote-tracking branch 'isis/bug25127'

7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Thu, 8 Feb 2018 15:29:06 +0000 (10:29 -0500)] 
Merge branch 'maint-0.3.2'

7 years agoMerge branch 'maint-0.3.1' into maint-0.3.2
Nick Mathewson [Thu, 8 Feb 2018 15:29:06 +0000 (10:29 -0500)] 
Merge branch 'maint-0.3.1' into maint-0.3.2

7 years agoMerge branch 'maint-0.2.9' into maint-0.3.1
Nick Mathewson [Thu, 8 Feb 2018 15:29:05 +0000 (10:29 -0500)] 
Merge branch 'maint-0.2.9' into maint-0.3.1

7 years agoMerge branch 'maint-0.2.5' into maint-0.2.9
Nick Mathewson [Thu, 8 Feb 2018 15:29:05 +0000 (10:29 -0500)] 
Merge branch 'maint-0.2.5' into maint-0.2.9

7 years agodirserv: Improve returned message when relay is rejected
David Goulet [Thu, 8 Feb 2018 14:42:26 +0000 (09:42 -0500)] 
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>
7 years agoUpdate geoip and geoip6 to the February 7 2018 database.
Karsten Loesing [Thu, 8 Feb 2018 09:32:41 +0000 (10:32 +0100)] 
Update geoip and geoip6 to the February 7 2018 database.

7 years agoprotover: Fix memleak in Rust impl of protover_compute_for_old_tor.
Isis Lovecruft [Tue, 6 Feb 2018 14:15:33 +0000 (14:15 +0000)] 
protover: Fix memleak in Rust impl of protover_compute_for_old_tor.

 * FIXES #25127: https://bugs.torproject.org/25127
 * ADDS a new module to the Rust tor_util crate for small utilities
   for working with static strings between languages.
 * CHANGES the return type of protover_compute_for_old_tor to point to
   immutable data.
 * CHANGES the code from the previous commit to use the new static
   string utilities.

7 years agoremove blank line between function-comment and function
Roger Dingledine [Wed, 7 Feb 2018 17:51:05 +0000 (12:51 -0500)] 
remove blank line between function-comment and function

also be more consistent about punctuation in doxygen comments

7 years agoMerge remote-tracking branch 'dgoulet/ticket25163_033_01'
Nick Mathewson [Wed, 7 Feb 2018 17:46:27 +0000 (12:46 -0500)] 
Merge remote-tracking branch 'dgoulet/ticket25163_033_01'

7 years agomore fixes for typos, grammar, whitespace, etc
Roger Dingledine [Wed, 7 Feb 2018 17:22:29 +0000 (12:22 -0500)] 
more fixes for typos, grammar, whitespace, etc

some of these ought to have been noticed by the "misspell" tool,
so if anybody is debugging it, here are some bug reports :)

7 years agoMerge remote-tracking branch 'dgoulet/bug25113_029_01'
Nick Mathewson [Wed, 7 Feb 2018 16:33:14 +0000 (11:33 -0500)] 
Merge remote-tracking branch 'dgoulet/bug25113_029_01'

7 years agotest: Bump to 10 msec gap in the monotonic test
David Goulet [Wed, 7 Feb 2018 15:23:24 +0000 (10:23 -0500)] 
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>
7 years agoFix wide lines from typo-fix patch.
Nick Mathewson [Wed, 7 Feb 2018 15:46:05 +0000 (10:46 -0500)] 
Fix wide lines from typo-fix patch.

7 years agochanges file for 23650 typo fixes
Nick Mathewson [Wed, 7 Feb 2018 15:44:21 +0000 (10:44 -0500)] 
changes file for 23650 typo fixes

7 years agoFix spelling mistakes corresponding to ticket #23650
Deepesh Pathak [Wed, 24 Jan 2018 08:55:15 +0000 (14:25 +0530)] 
Fix spelling mistakes corresponding to ticket #23650

7 years agoImprove doc of `primary_guards_up_to_date`.
George Kadianakis [Wed, 7 Feb 2018 09:46:30 +0000 (11:46 +0200)] 
Improve doc of `primary_guards_up_to_date`.

7 years agorephist: Stop tracking relay connection status
David Goulet [Tue, 6 Feb 2018 17:51:43 +0000 (12:51 -0500)] 
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>
7 years agorephist: Stop tracking EXTEND attempts
David Goulet [Tue, 6 Feb 2018 17:43:55 +0000 (12:43 -0500)] 
rephist: Stop tracking EXTEND attempts

This removes the code that tracks the extend attemps a client makes. We don't
use it and it was only used to provide statistics on a SIGUSR1 from the
rephist dump stats function.

Part of #25163

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoMerge remote-tracking branch 'dgoulet/bug25116_029_01'
Nick Mathewson [Tue, 6 Feb 2018 17:13:41 +0000 (12:13 -0500)] 
Merge remote-tracking branch 'dgoulet/bug25116_029_01'

7 years agoMerge branch 'arma_bug22212_031'
Nick Mathewson [Tue, 6 Feb 2018 16:41:52 +0000 (11:41 -0500)] 
Merge branch 'arma_bug22212_031'

7 years agoAdd a category for the 22212-forreal changes file
Nick Mathewson [Tue, 6 Feb 2018 16:41:31 +0000 (11:41 -0500)] 
Add a category for the 22212-forreal changes file

7 years agoMerge remote-tracking branch 'arma/bug22212'
Nick Mathewson [Tue, 6 Feb 2018 16:36:13 +0000 (11:36 -0500)] 
Merge remote-tracking branch 'arma/bug22212'

7 years agoprotover: Fix memleak in Rust implementation.
Isis Lovecruft [Tue, 6 Feb 2018 02:31:04 +0000 (02:31 +0000)] 
protover: Fix memleak in Rust implementation.

 * FIXES #25127: https://bugs.torproject.org/25127.

7 years agoMerge remote-tracking branch 'dgoulet/ticket24902_029_05'
Nick Mathewson [Mon, 5 Feb 2018 19:00:50 +0000 (14:00 -0500)] 
Merge remote-tracking branch 'dgoulet/ticket24902_029_05'

7 years agoMake circuit_log_ancient_one_hop_circuits() ignore established service rendezvous
David Goulet [Mon, 5 Feb 2018 15:52:17 +0000 (10:52 -0500)] 
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>
7 years agogeoip: Make geoip_client_cache_total_allocation() return the counter
David Goulet [Mon, 5 Feb 2018 15:39:10 +0000 (10:39 -0500)] 
geoip: Make geoip_client_cache_total_allocation() return the counter

The HT_FOREACH() is insanely heavy on the CPU and this is part of the fast
path so make it return the nice memory size counter we added in
4d812e29b9b1ec88.

Fixes #25148

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoMerge remote-tracking branch 'dgoulet/ticket24902_029_05'
Nick Mathewson [Mon, 5 Feb 2018 16:38:58 +0000 (11:38 -0500)] 
Merge remote-tracking branch 'dgoulet/ticket24902_029_05'

7 years agofuzz: Move init_protocol_warning_severity_level() into global_init()
Nick Mathewson [Fri, 2 Feb 2018 22:42:23 +0000 (17:42 -0500)] 
fuzz: Move init_protocol_warning_severity_level() into global_init()

This is needed so llvm_fuzz will see it too.

7 years agodos: We can put less token than the current amount
David Goulet [Fri, 2 Feb 2018 22:04:12 +0000 (17:04 -0500)] 
dos: We can put less token than the current amount

Becasue the circuit creation burst and rate can change at runtime it is
possible that between two refill of a bucket, we end up setting the bucket
value to less than there currently is.

Fixes #25128

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoUse tt_u64_op() for uint64_t inputs.
Nick Mathewson [Fri, 2 Feb 2018 20:23:55 +0000 (15:23 -0500)] 
Use tt_u64_op() for uint64_t inputs.

7 years agoMerge remote-tracking branch 'dgoulet/ticket24902_029_05'
Nick Mathewson [Fri, 2 Feb 2018 20:00:35 +0000 (15:00 -0500)] 
Merge remote-tracking branch 'dgoulet/ticket24902_029_05'

7 years agoMerge branch 'ticket25122_029_02' into ticket24902_029_05
David Goulet [Fri, 2 Feb 2018 19:55:01 +0000 (14:55 -0500)] 
Merge branch 'ticket25122_029_02' into ticket24902_029_05

7 years agogeoip: Add clientmap_entry_new() function
David Goulet [Fri, 2 Feb 2018 18:24:37 +0000 (13:24 -0500)] 
geoip: Add clientmap_entry_new() function

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agogeoip: Increment and decrement functions for the geoip client cache
David Goulet [Fri, 2 Feb 2018 18:14:50 +0000 (13:14 -0500)] 
geoip: Increment and decrement functions for the geoip client cache

These functions protect againts over and underflow. They BUG() in case we
overflow the counter.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agogeoip: Hook the client history cache into the OOM handler
David Goulet [Fri, 2 Feb 2018 15:15:28 +0000 (10:15 -0500)] 
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>
7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Fri, 2 Feb 2018 17:03:54 +0000 (12:03 -0500)] 
Merge branch 'maint-0.3.2'

7 years agoMerge branch 'bug25125_032_01_squashed' into maint-0.3.2
Nick Mathewson [Fri, 2 Feb 2018 17:03:48 +0000 (12:03 -0500)] 
Merge branch 'bug25125_032_01_squashed' into maint-0.3.2

7 years agosched: When releasing a channel, do not BUG() if absent from the pending list
David Goulet [Fri, 2 Feb 2018 13:48:34 +0000 (08:48 -0500)] 
sched: When releasing a channel, do not BUG() if absent from the pending list

The current code flow makes it that we can release a channel in a PENDING
state but not in the pending list. This happens while the channel is being
processed in the scheduler loop.

Fixes #25125

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Thu, 1 Feb 2018 22:05:14 +0000 (17:05 -0500)] 
Merge branch 'maint-0.3.2'

7 years agotest: KIST Scheduler unit tests to test the pending list state
David Goulet [Thu, 1 Feb 2018 20:48:28 +0000 (15:48 -0500)] 
test: KIST Scheduler unit tests to test the pending list state

This tests many cases of the KIST scheduler with the pending list state by
calling entry point in the scheduler while channels are scheduled or not.

Also, it adds a test for the bug #24700.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoMerge remote-tracking branch 'dgoulet/bug24700_032_01' into maint-0.3.2
Nick Mathewson [Thu, 1 Feb 2018 21:57:57 +0000 (16:57 -0500)] 
Merge remote-tracking branch 'dgoulet/bug24700_032_01' into maint-0.3.2

7 years agoMerge branch 'bug24700_032_01' into bug24700_033_01
David Goulet [Thu, 1 Feb 2018 21:39:04 +0000 (16:39 -0500)] 
Merge branch 'bug24700_032_01' into bug24700_033_01

7 years agosched: Use the sched_heap_idx field to double-check our fix for 24700.
Nick Mathewson [Thu, 1 Feb 2018 16:05:50 +0000 (11:05 -0500)] 
sched: Use the sched_heap_idx field to double-check our fix for 24700.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoMerge remote-tracking branch 'teor/bug25070'
Nick Mathewson [Thu, 1 Feb 2018 20:28:25 +0000 (15:28 -0500)] 
Merge remote-tracking branch 'teor/bug25070'

7 years agoMerge branch 'maint-0.3.1' into maint-0.3.2
Nick Mathewson [Thu, 1 Feb 2018 20:28:17 +0000 (15:28 -0500)] 
Merge branch 'maint-0.3.1' into maint-0.3.2

7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Thu, 1 Feb 2018 20:28:17 +0000 (15:28 -0500)] 
Merge branch 'maint-0.3.2'

7 years agoMerge remote-tracking branch 'teor/bug25070_031' into maint-0.3.1
Nick Mathewson [Thu, 1 Feb 2018 20:28:11 +0000 (15:28 -0500)] 
Merge remote-tracking branch 'teor/bug25070_031' into maint-0.3.1

7 years agoMerge branch 'bug24658-rsa_squashed'
Nick Mathewson [Thu, 1 Feb 2018 17:10:07 +0000 (12:10 -0500)] 
Merge branch 'bug24658-rsa_squashed'

7 years agoAdd crypto_rsa.[ch] to include.am
Fernando Fernandez Mancera [Fri, 26 Jan 2018 16:01:33 +0000 (17:01 +0100)] 
Add crypto_rsa.[ch] to include.am

Included crypto_rsa.[ch] into include.am in order to resolve a compiling issue.

Follows #24658.

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
7 years agoTweaks into functions and variables in crypto_rsa.[ch]
Fernando Fernandez Mancera [Fri, 26 Jan 2018 15:43:46 +0000 (16:43 +0100)] 
Tweaks into functions and variables in crypto_rsa.[ch]

crypto_get_rsa_padding_overhead() and crypto_get_rsa_padding() are
not static inline anymore in order to split the crypto_rsa module
from crypto.[ch].

Also included necessary modules in order to solve dependency issues.

Also made two functions in crypto.c use crypto_pk_asn1_encdoe()
instead of reaching into the crypto_pk_t struct.

7 years agoRemove commented functions in crypto module.
Fernando Fernandez Mancera [Thu, 1 Feb 2018 15:42:30 +0000 (16:42 +0100)] 
Remove commented functions in crypto module.

OpenSSL never uses these callbacks anymore so the code is disabled.

Fixes #25097.

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
7 years agoRemove nodelist_recompute_all_hsdir_indices() as unused.
Nick Mathewson [Thu, 1 Feb 2018 13:44:47 +0000 (08:44 -0500)] 
Remove nodelist_recompute_all_hsdir_indices() as unused.

Closes 25108.

7 years agoRevert "Change the sandbox behavior on all failed opens() to EACCES"
Nick Mathewson [Thu, 1 Feb 2018 13:39:38 +0000 (08:39 -0500)] 
Revert "Change the sandbox behavior on all failed opens() to EACCES"

This reverts commit 9a06282546418b2e9d21559d4853bcf124b953f4.

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).

7 years agoMerge remote-tracking branch 'dgoulet/bug24469_033_01'
Nick Mathewson [Thu, 1 Feb 2018 13:22:44 +0000 (08:22 -0500)] 
Merge remote-tracking branch 'dgoulet/bug24469_033_01'

7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Thu, 1 Feb 2018 13:13:35 +0000 (08:13 -0500)] 
Merge branch 'maint-0.3.2'

7 years agoMerge remote-tracking branch 'dgoulet/bug24975_032_01' into maint-0.3.2
Nick Mathewson [Thu, 1 Feb 2018 13:10:34 +0000 (08:10 -0500)] 
Merge remote-tracking branch 'dgoulet/bug24975_032_01' into maint-0.3.2

7 years agoMerge remote-tracking branch 'dgoulet/ticket24902_029_05'
Nick Mathewson [Wed, 31 Jan 2018 21:17:04 +0000 (16:17 -0500)] 
Merge remote-tracking branch 'dgoulet/ticket24902_029_05'

7 years agochannel_tls_get_remote_addr_method now returns real_addr.
Fernando Fernandez Mancera [Mon, 22 Jan 2018 14:20:17 +0000 (15:20 +0100)] 
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>
7 years agocirc: Don't cannibalize a circuit if the guard state is unusable
David Goulet [Wed, 31 Jan 2018 20:23:45 +0000 (15:23 -0500)] 
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>
7 years agoMerge remote-tracking branch 'public/bug16106_02_nm'
Nick Mathewson [Wed, 31 Jan 2018 20:51:58 +0000 (15:51 -0500)] 
Merge remote-tracking branch 'public/bug16106_02_nm'

7 years agoMerge branch 'bug23954_squashed'
Nick Mathewson [Wed, 31 Jan 2018 19:37:48 +0000 (14:37 -0500)] 
Merge branch 'bug23954_squashed'

7 years agoUse thread-safe types to store the LOG_PROTOCOL_WARN severity
Nick Mathewson [Wed, 24 Jan 2018 17:02:44 +0000 (12:02 -0500)] 
Use thread-safe types to store the LOG_PROTOCOL_WARN severity

Fixes a race condition; resolves 23954.

7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Wed, 31 Jan 2018 19:33:27 +0000 (14:33 -0500)] 
Merge branch 'maint-0.3.2'

"ours" merge to avoid backport of #25105

7 years agoMerge branch 'bug25105_032' into maint-0.3.2
Nick Mathewson [Wed, 31 Jan 2018 19:33:12 +0000 (14:33 -0500)] 
Merge branch 'bug25105_032' into maint-0.3.2

7 years agoMerge branch 'bug25008'
Nick Mathewson [Wed, 31 Jan 2018 19:32:24 +0000 (14:32 -0500)] 
Merge branch 'bug25008'

7 years agons: Add a before and after consensus has changed notification
David Goulet [Wed, 31 Jan 2018 19:15:02 +0000 (14:15 -0500)] 
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

7 years agoLook at the correct protocol for supports_v3_rendezvous_point
Nick Mathewson [Wed, 31 Jan 2018 19:01:49 +0000 (14:01 -0500)] 
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 bbf2d9cf6bb97c3e15ada58 for 0.3.2.)

7 years agoFix a failing unit test.
Nick Mathewson [Wed, 31 Jan 2018 19:06:37 +0000 (14:06 -0500)] 
Fix a failing unit test.

When we stopped looking at the "protocols" variable directly, we
broke the hs_service/build_update_descriptors test, since it didn't
actually update any of the flags.

The fix here is to call summarize_protover_flags() from that test,
and to expose summarize_protover_flags() as "STATIC" from
routerparse.c.

7 years agoLook at the correct protocol for supports_v3_rendezvous_point
Nick Mathewson [Wed, 31 Jan 2018 19:01:49 +0000 (14:01 -0500)] 
Look at the correct protocol for supports_v3_rendezvous_point

Fixes bug 25105; bugfix on 0.3.2.1-alpha.

7 years agoRevert "ns: Call notify_networkstatus_changed() after the new consensus is set globally"
David Goulet [Wed, 31 Jan 2018 18:59:05 +0000 (13:59 -0500)] 
Revert "ns: Call notify_networkstatus_changed() after the new consensus is set globally"

This reverts commit 3a247ca92a06c864a2cb634fbe2bc23cf48fb977.

7 years agoDocument remaining cases for protocol support
Nick Mathewson [Wed, 31 Jan 2018 18:50:04 +0000 (13:50 -0500)] 
Document remaining cases for protocol support

For each support flag, document which subprotocol version it requires.

7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Wed, 31 Jan 2018 18:47:01 +0000 (13:47 -0500)] 
Merge branch 'maint-0.3.2'

7 years agoMerge remote-tracking branch 'dgoulet/bug24975_032_01' into maint-0.3.2
Nick Mathewson [Wed, 31 Jan 2018 18:46:58 +0000 (13:46 -0500)] 
Merge remote-tracking branch 'dgoulet/bug24975_032_01' into maint-0.3.2

7 years agosched: Avoid adding the same channel twice to the KIST pending list
David Goulet [Wed, 31 Jan 2018 18:46:31 +0000 (13:46 -0500)] 
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>
7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Wed, 31 Jan 2018 17:51:45 +0000 (12:51 -0500)] 
Merge branch 'maint-0.3.2'

7 years agohs-v3: Remove a BUG() when storing a descriptor in the client cache
David Goulet [Wed, 31 Jan 2018 15:58:11 +0000 (10:58 -0500)] 
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>
7 years agons: Call notify_networkstatus_changed() after the new consensus is set globally
David Goulet [Wed, 31 Jan 2018 16:08:33 +0000 (11:08 -0500)] 
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>
7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Wed, 31 Jan 2018 15:06:49 +0000 (10:06 -0500)] 
Merge branch 'maint-0.3.2'

7 years agoMerge branch 'maint-0.3.1' into maint-0.3.2
Nick Mathewson [Wed, 31 Jan 2018 15:06:49 +0000 (10:06 -0500)] 
Merge branch 'maint-0.3.1' into maint-0.3.2

7 years agoBut in most Earth cultures, there are 60s in a minute.
Nick Mathewson [Wed, 31 Jan 2018 15:06:43 +0000 (10:06 -0500)] 
But in most Earth cultures, there are 60s in a minute.

7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Wed, 31 Jan 2018 15:01:13 +0000 (10:01 -0500)] 
Merge branch 'maint-0.3.2'

7 years agoMerge branch 'maint-0.3.1' into maint-0.3.2
Nick Mathewson [Wed, 31 Jan 2018 15:01:13 +0000 (10:01 -0500)] 
Merge branch 'maint-0.3.1' into maint-0.3.2

7 years agoadd a rate-limit.
Nick Mathewson [Wed, 31 Jan 2018 15:01:10 +0000 (10:01 -0500)] 
add a rate-limit.

7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Wed, 31 Jan 2018 14:50:24 +0000 (09:50 -0500)] 
Merge branch 'maint-0.3.2'

7 years agoMerge branch 'maint-0.3.1' into maint-0.3.2
Nick Mathewson [Wed, 31 Jan 2018 14:50:24 +0000 (09:50 -0500)] 
Merge branch 'maint-0.3.1' into maint-0.3.2

7 years agoMerge branch 'bug24927'
Nick Mathewson [Wed, 31 Jan 2018 14:47:36 +0000 (09:47 -0500)] 
Merge branch 'bug24927'

7 years agoMerge remote-tracking branch 'public/ticket24849_032'
Nick Mathewson [Wed, 31 Jan 2018 14:38:24 +0000 (09:38 -0500)] 
Merge remote-tracking branch 'public/ticket24849_032'

7 years agoMerge remote-tracking branch 'dgoulet/ticket24902_029_05'
Nick Mathewson [Wed, 31 Jan 2018 14:35:07 +0000 (09:35 -0500)] 
Merge remote-tracking branch 'dgoulet/ticket24902_029_05'

7 years agotest: Add unit tests for overflows and underflows in cc_stats_refill_bucket
teor [Wed, 31 Jan 2018 00:22:20 +0000 (11:22 +1100)] 
test: Add unit tests for overflows and underflows in cc_stats_refill_bucket

Closes #25094.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agodos: Make sure cc_stats_refill_bucket can't overflow while calculating
teor [Wed, 31 Jan 2018 00:13:17 +0000 (11:13 +1100)] 
dos: Make sure cc_stats_refill_bucket can't overflow while calculating

Debug log the elapsed time in cc_stats_refill_bucket

Part of #25094.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoMerge branch 'maint-0.3.2'
Nick Mathewson [Wed, 31 Jan 2018 14:19:55 +0000 (09:19 -0500)] 
Merge branch 'maint-0.3.2'

7 years agotest: Remove a redundant round from test_dos_bucket_refill
teor [Wed, 31 Jan 2018 00:11:08 +0000 (11:11 +1100)] 
test: Remove a redundant round from test_dos_bucket_refill

This round is left over from the tenths of a second code.

Part of #25094.

7 years agocount flushing as channel activity
Roger Dingledine [Wed, 31 Jan 2018 10:26:06 +0000 (05:26 -0500)] 
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".

7 years agoremove a redundant semicolon
Nick Mathewson [Tue, 30 Jan 2018 23:11:16 +0000 (18:11 -0500)] 
remove a redundant semicolon