Commit Graph

10377 Commits

Author SHA1 Message Date
David Goulet
f2e9ce72d6 dirauth: Reject 0.4.6.x series at the authority level
Closes #40664

Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-01-12 09:07:52 -05:00
David Goulet
b9c7825f0e Merge branch 'maint-0.4.5' into maint-0.4.7 2023-01-11 09:03:29 -05:00
David Goulet
85547a9b5b Merge branch 'tor-gitlab/mr/538' into maint-0.4.5 2023-01-11 09:03:26 -05:00
Mike Perry
894ddb837c Changes file for bug 40732 2023-01-10 11:56:21 -05:00
David Goulet
726e9ec0a3 sandbox: Allow my-consensus-* files for an authority
Fixes #40729

Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-01-10 09:02:13 -05:00
Alex Xu (Hello71)
1d9166c8c9 Enable IP_BIND_ADDRESS_NO_PORT if supported
Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-12-20 09:09:33 -05:00
David Goulet
da48104c99 Merge branch 'tor-gitlab/mr/667' into maint-0.4.7 2022-12-12 15:07:00 -05:00
qontinuum
3c968ca996
Add issue40613 2022-12-11 10:14:26 +01:00
David Goulet
1d1eb29443 metrics: Fix typo in a label
Fixes #40727

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-12-07 08:43:41 -05:00
David Goulet
d889eba875 Merge branch 'maint-0.4.5' into maint-0.4.7 2022-12-06 10:10:41 -05:00
Tor CI Release
1992c553d5 fallbackdir: Update list generated on December 06, 2022 2022-12-06 10:09:32 -05:00
Tor CI Release
ec0414270a Update geoip files to match ipfire location db, 2022/12/06. 2022-12-06 10:09:26 -05:00
David Goulet
01efb15496 Merge branch 'maint-0.4.5' into maint-0.4.7 2022-12-06 08:56:04 -05:00
Mike Perry
4c419183cc Ticket 40724: Changes file 2022-12-01 22:22:45 +00:00
Roger Dingledine
72b04a5aa4 dirauth: rotate moria1 keys and ports
Rotate the relay identity key and v3 identity key for moria1. They
have been online for more than a decade, there was a known potential
compromise, and anyway refreshing keys periodically is good practice.

Advertise new ports too, to avoid confusion.

Closes ticket 40722.
2022-11-29 20:33:58 -05:00
David Goulet
efeef819f5 changes: Add file for ticket 40674
Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-11-28 10:25:48 -05:00
David Goulet
fbc9e92fdb relay: Use the configured number of threads for worker work calculation
We cap our number of CPU worker threads to at least 2 even if we have a
single core. But also, before we used to always add one extra thread
regardless of the number of core.

This meant that we were off when re-using the get_num_cpus() function
when calculating our onionskin work overhead because we were always off
by one.

This commit makes it that we always use the number of thread our actual
thread pool was configured with.

Fixes #40719

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-11-23 14:05:10 -05:00
Tor CI Release
58bd4e0899 fallbackdir: Update list generated on November 10, 2022 2022-11-10 09:43:55 -05:00
Tor CI Release
e39be4a14f Update geoip files to match ipfire location db, 2022/11/10. 2022-11-10 09:43:47 -05:00
David Goulet
e2a94e050d changes: Add file for ticket 40674
Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-11-09 15:35:51 -05:00
David Goulet
e3f6908984 relay: Make the max pending tasks per CPU a consensus parameter
Until now, there was this magic number (64) used as the maximum number
of tasks a CPU worker can take at once.

This commit makes it a consensus parameter so our future selves can
think of a better value depending on network conditions.

Part of #40704

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-11-09 13:13:21 -05:00
David Goulet
9c8c7804d5 relay: Add the onion_queue_wait_cutoff consensus param
Transform the hardcoded value ONIONQUEUE_WAIT_CUTOFF into a consensus
parameter so we can control it network wide.

Closes #40704

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-11-09 11:57:32 -05:00
David Goulet
fde87096c3 Merge branch 'tor-gitlab/mr/650' into maint-0.4.7 2022-11-08 12:36:19 -05:00
David Goulet
d634a5ebc7 relay: Remove unused conn->ext_or_conn_id
This also incidently removes a use of uninitialized stack data from the
connection_or_set_ext_or_identifier() function.

Fixes #40648

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-11-08 12:35:09 -05:00
David Goulet
f270d20cb0 changes: Add file for ticket 40708
Closes #40708

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-11-07 09:55:06 -05:00
David Goulet
619dd35321 sandbox: Add my-consensus-<flavor-name> to sandbox for dirauth
Fixese #40663

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-31 11:37:43 -04:00
David Goulet
5db238f3e3 thread: Bump max detectable CPU from 16 to 128
Lets take advantage of those beefy machines ;).

Closes #40703

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-28 11:28:43 -04:00
David Goulet
f09b913e18 Merge branch 'tor-gitlab/mr/645' into maint-0.4.7 2022-10-27 11:42:07 -04:00
Mike Perry
b30193416c Changes file for 40683 2022-10-27 15:36:53 +00:00
David Goulet
504a6da5ab changes: Update changes for ticket 40194
Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-27 10:50:37 -04:00
David Goulet
609a82a595 changes: Ticket 40694
Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-26 15:10:41 -04:00
David Goulet
a7aa22a4e7 hs: Retry rdv circuit if repurposed
This can happen if our measurement subsystem decides to snatch it.

Fixes #40696

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-26 15:05:44 -04:00
David Goulet
0a49e04691 Merge branch 'tor-gitlab/mr/635' into maint-0.4.7 2022-10-26 15:01:40 -04:00
David Goulet
59008c6f51 hs: Change the error for a collapsing client circuit
Change it to an "unreachable" error so the intro point can be retried
and not flagged as a failure and never retried again.

Closes #40692

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-26 14:56:45 -04:00
David Goulet
a317326aae Merge branch 'maint-0.4.5' into maint-0.4.7 2022-10-26 14:21:41 -04:00
David Goulet
7a851e8983 Merge branch 'tor-gitlab/mr/631' into maint-0.4.5 2022-10-26 14:21:35 -04:00
David Goulet
efad436432 dirauth: Remove Faravahar
Closes #40688

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-26 14:20:07 -04:00
David Goulet
e19cf2dac6 Merge branch 'maint-0.4.5' into maint-0.4.7 2022-10-26 14:12:51 -04:00
David Goulet
b20f72943e Merge branch 'tor-gitlab/mr/629' into maint-0.4.7 2022-10-26 14:06:33 -04:00
David Goulet
a2c034d8f5 dos: Apply circuit creation defenses if circ max queue cell reached
This adds two consensus parameters to control the outbound max circuit
queue cell size limit and how many times it is allowed to reach that
limit for a single client IP.

Closes #40680

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-26 14:05:28 -04:00
Roger Dingledine
bab8375ef5 dir auths now omit Measured= if rs->is_authority
Directory authorities stop voting a consensus "Measured" weight
for relays with the Authority flag. Now these relays will be
considered unmeasured, which should reserve their bandwidth
for their dir auth role and minimize distractions from other roles.

In place of the "Measured" weight, they now include a
"MeasuredButAuthority" weight (not used by anything) so the bandwidth
authority's opinion on this relay can be recorded for posterity.

Resolves ticket 40698.
2022-10-24 04:34:49 -04:00
Roger Dingledine
e6899dcdf4 fix typo in #40673's changes file 2022-10-20 19:46:27 -04:00
David Goulet
938070f5c4 dirauth: Change dizum IP address
Closes #40687

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-18 10:35:54 -04:00
David Goulet
e86833ade6 Merge branch 'maint-0.4.5' into maint-0.4.7 2022-10-14 09:12:23 -04:00
Nick Mathewson
e531d4d1b9 Fix a completely wrong calculation in mach monotime_init_internal()
Bug 1: We were purporting to calculate milliseconds per tick, when we
*should* have been computing ticks per millisecond.

Bug 2: Instead of computing either one of those, we were _actually_
computing femtoseconds per tick.

These two bugs covered for one another on x86 hardware, where 1 tick
== 1 nanosecond.  But on M1 OSX, 1 tick is about 41 nanoseconds,
causing surprising results.

Fixes bug 40684; bugfix on 0.3.3.1-alpha.
2022-10-13 13:40:10 -04:00
David Goulet
d543db5ac0 relay: Add connection stats to MetricsPort
This adds the number of created and opened connections to the
MetricsPort for a relay for each connection type and direction.

Output looks like:

  # HELP tor_relay_connections Connections metrics of this relay
  # TYPE tor_relay_connections counter
  tor_relay_connections{type="OR listener",direction="initiated",state="created"} 0
  tor_relay_connections{type="OR listener",direction="received",state="created"} 0
  tor_relay_connections{type="OR listener",direction="initiated",state="opened"} 0
  tor_relay_connections{type="OR listener",direction="received",state="opened"} 0
  tor_relay_connections{type="OR",direction="initiated",state="created"} 5
  tor_relay_connections{type="OR",direction="received",state="created"} 0
  tor_relay_connections{type="OR",direction="initiated",state="opened"} 5
  tor_relay_connections{type="OR",direction="received",state="opened"} 0
  tor_relay_connections{type="Exit",direction="initiated",state="created"} 0
  tor_relay_connections{type="Exit",direction="received",state="created"} 0
  tor_relay_connections{type="Exit",direction="initiated",state="opened"} 0
  tor_relay_connections{type="Exit",direction="received",state="opened"} 0
  tor_relay_connections{type="Socks listener",direction="initiated",state="created"} 0
  tor_relay_connections{type="Socks listener",direction="received",state="created"} 0
  tor_relay_connections{type="Socks listener",direction="initiated",state="opened"} 0
  tor_relay_connections{type="Socks listener",direction="received",state="opened"} 0
  tor_relay_connections{type="Socks",direction="initiated",state="created"} 0
  tor_relay_connections{type="Socks",direction="received",state="created"} 0
  tor_relay_connections{type="Socks",direction="initiated",state="opened"} 0
  tor_relay_connections{type="Socks",direction="received",state="opened"} 0
  tor_relay_connections{type="Directory listener",direction="initiated",state="created"} 0
  tor_relay_connections{type="Directory listener",direction="received",state="created"} 0
  tor_relay_connections{type="Directory listener",direction="initiated",state="opened"} 0
  tor_relay_connections{type="Directory listener",direction="received",state="opened"} 0
  tor_relay_connections{type="Directory",direction="initiated",state="created"} 0
  tor_relay_connections{type="Directory",direction="received",state="created"} 0
  tor_relay_connections{type="Directory",direction="initiated",state="opened"} 0
  tor_relay_connections{type="Directory",direction="received",state="opened"} 0
  tor_relay_connections{type="Control listener",direction="initiated",state="created"} 0
  tor_relay_connections{type="Control listener",direction="received",state="created"} 0
  tor_relay_connections{type="Control listener",direction="initiated",state="opened"} 0
  tor_relay_connections{type="Control listener",direction="received",state="opened"} 0
  tor_relay_connections{type="Control",direction="initiated",state="created"} 0
  tor_relay_connections{type="Control",direction="received",state="created"} 0
  tor_relay_connections{type="Control",direction="initiated",state="opened"} 0
  tor_relay_connections{type="Control",direction="received",state="opened"} 0
  tor_relay_connections{type="Transparent pf/netfilter listener",direction="initiated",state="created"} 0
  tor_relay_connections{type="Transparent pf/netfilter listener",direction="received",state="created"} 0
  tor_relay_connections{type="Transparent pf/netfilter listener",direction="initiated",state="opened"} 0
  tor_relay_connections{type="Transparent pf/netfilter listener",direction="received",state="opened"} 0
  tor_relay_connections{type="Transparent natd listener",direction="initiated",state="created"} 0
  tor_relay_connections{type="Transparent natd listener",direction="received",state="created"} 0
  tor_relay_connections{type="Transparent natd listener",direction="initiated",state="opened"} 0
  tor_relay_connections{type="Transparent natd listener",direction="received",state="opened"} 0
  tor_relay_connections{type="DNS listener",direction="initiated",state="created"} 0
  tor_relay_connections{type="DNS listener",direction="received",state="created"} 0
  tor_relay_connections{type="DNS listener",direction="initiated",state="opened"} 0
  tor_relay_connections{type="DNS listener",direction="received",state="opened"} 0
  tor_relay_connections{type="Extended OR",direction="initiated",state="created"} 0
  tor_relay_connections{type="Extended OR",direction="received",state="created"} 0
  tor_relay_connections{type="Extended OR",direction="initiated",state="opened"} 0
  tor_relay_connections{type="Extended OR",direction="received",state="opened"} 0
  tor_relay_connections{type="Extended OR listener",direction="initiated",state="created"} 0
  tor_relay_connections{type="Extended OR listener",direction="received",state="created"} 0
  tor_relay_connections{type="Extended OR listener",direction="initiated",state="opened"} 0
  tor_relay_connections{type="Extended OR listener",direction="received",state="opened"} 0
  tor_relay_connections{type="HTTP tunnel listener",direction="initiated",state="created"} 0
  tor_relay_connections{type="HTTP tunnel listener",direction="received",state="created"} 0
  tor_relay_connections{type="HTTP tunnel listener",direction="initiated",state="opened"} 0
  tor_relay_connections{type="HTTP tunnel listener",direction="received",state="opened"} 0
  tor_relay_connections{type="Metrics listener",direction="initiated",state="created"} 0
  tor_relay_connections{type="Metrics listener",direction="received",state="created"} 1
  tor_relay_connections{type="Metrics listener",direction="initiated",state="opened"} 0
  tor_relay_connections{type="Metrics listener",direction="received",state="opened"} 1
  tor_relay_connections{type="Metrics",direction="initiated",state="created"} 0
  tor_relay_connections{type="Metrics",direction="received",state="created"} 0
  tor_relay_connections{type="Metrics",direction="initiated",state="opened"} 0
  tor_relay_connections{type="Metrics",direction="received",state="opened"} 0

Related to #40194

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-12 09:25:19 -04:00
Andy
d09414858e Properly compute cell-drop overload fraction
Patch to address #40673. An additional check has been added to
onion_pending_add() in order to ensure that we avoid counting create
cells from clients.

In the cpuworker.c assign_onionskin_to_cpuworker
method if total_pending_tasks >= max_pending_tasks
and channel_is_client(circ->p_chan) returns false then
rep_hist_note_circuit_handshake_dropped() will be called and
rep_hist_note_circuit_handshake_assigned() will not be called. This
causes relays to run into errors due to the fact that the number of
dropped packets exceeds the total number of assigned packets.

To avoid this situation a check has been added to
onion_pending_add() to ensure that these erroneous calls to
rep_hist_note_circuit_handshake_dropped() are not made.

See the #40673 ticket for the conversation with armadev about this issue.
2022-10-06 00:46:29 -04:00
David Goulet
c4ff6a4f55 Merge branch 'maint-0.4.6' into maint-0.4.7 2022-08-12 09:56:54 -04:00
David Goulet
8244eefcd3 Merge branch 'maint-0.4.5' into maint-0.4.6 2022-08-12 09:56:54 -04:00
David Goulet
bb88086c72 geoip: Update geoip files with August 9th, 2022 database
Fixes #40658

Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-08-12 09:56:50 -04:00