Commit Graph

28438 Commits

Author SHA1 Message Date
David Goulet
29e3601c42 Merge branch 'tor-gitlab/mr/808' into maint-0.4.8 2024-04-15 15:11:16 -04:00
David Goulet
612b801ea5 conflux: Don't process a closed circuit on get packaged window
Signed-off-by: David Goulet <dgoulet@torproject.org>
2024-04-15 14:45:29 -04:00
David Goulet
269b4561a1 conflux: Avoid noting a cell was sent on a closed circuit
It turns out that circuit_package_relay_cell() returns 0 in order to drop a
cell but there is a code path, if the circuit queue is full, that also silently
closes the circuit and returns 0.

This lead to Conflux thinking a cell was sent but actually the cell was not and
the circuit was closed leading to the hard assert.

And so this function makes sure that circuit_package_relay_cell() and
append_cell_to_circuit_queue() returns a value that indicate what happened with
the cell and circuit so the caller can make an informed decision with it.

This change makes it that we do NOT enter the Conflux subsystem if the cell is
not queued on the circuit.

Fixes #40921

Signed-off-by: David Goulet <dgoulet@torproject.org>
2024-04-15 14:24:45 -04:00
trinity-1686a
c84ea8bd0d rename metric bug_reached to bug_reached_count 2024-04-14 14:58:58 +02:00
trinity-1686a
e95375ec99 also consider LD_BUG logs when counting bug reached 2024-04-13 22:15:09 +02:00
David Goulet
94bcfd042b Merge branch 'maint-0.4.8' 2024-04-10 12:59:04 -04:00
Tor CI Release
461679e8c0 fallbackdir: Update list generated on April 10, 2024 2024-04-10 12:58:56 -04:00
Tor CI Release
3064d57712 Update geoip files to match ipfire location db, 2024/04/10. 2024-04-10 12:58:51 -04:00
David Goulet
deae11797a Merge branch 'maint-0.4.8' 2024-04-09 09:23:47 -04:00
David Goulet
e3e4fa35e8 dirauth: New keys and address for tor26
Signed-off-by: David Goulet <dgoulet@torproject.org>
2024-04-08 10:57:29 -04:00
David Goulet
51ef4ce094 test: Disable unit test causing issue with nightly package
Signed-off-by: David Goulet <dgoulet@torproject.org>
2024-03-20 09:23:24 -04:00
Jim Newsome
d224961609 hs_service: don't force high intro point rotation for TestingTorNetwork
This was previously added to facilitate testing intro point rotation
with chutney. However, the implementation is problematic since it forces
excessive rotation whenever TestingTorNetwork is enabled, and can't be
adjusted or disabled.

Alternatives for testing intro point rotation include:
 * Using shadow to "fast forward" time
 * Overriding the consensus parameters hs_intro_min_lifetime and
   hs_intro_max_lifetime.

Fixes #40922
2024-03-14 09:36:59 -05:00
Jim Newsome
4fc43ebdee In router_is_active, don't require non-zero bandwidthcapacity
This check was originally added in 962765a3, with the intent of
preventing relays with 0 measured bandwidth from being listed in the
consensus (part of fixing #13000).

Currently, that decision and other relevant places effectively use
`dirserv_get_credible_bandwidth_kb`, which prefers bwauth-measured
bandwidth over the self-reported `bandwidthcapacity`, making this check
mostly redundant.

i.e. this change should only affect behavior when the relay has uploaded
a descriptor with `bandwidthcapacity=0` *and* we have a non-zero
measured bandwidth, in which case we'll still trust the measured
bandwidth. This is what we want when bootstrapping a network (e.g. for
testing), since it allows us to initialize bandwidths using a bandwidth
authority file.

A relay can still cause `router_is_active` to return false by setting
the hibernate flag.

Also see discussion in #40917.

Fixes #40917.
2024-03-07 12:39:40 -06:00
Alexander Færøy
a5d53ce416 Merge branch 'document-read-until-eof' into 'main'
make read_file_to_str_until_eof doc more explicit

Closes #40852

See merge request tpo/core/tor!799
2024-02-28 16:56:24 +00:00
Alexander Færøy
72ac1de514 Merge branch 'maint-0.4.8' 2024-02-28 16:52:56 +00:00
trinity-1686a
e913de1bc6 make read_file_to_str_until_eof doc more explicit
the sz_out param is set to what was read (i.e not including the final
NULL the function adds for convenience), but could be understood to
be set to what was read+1 (including the NULL terminator)
2024-02-18 12:44:45 +01:00
David Goulet
b0b943a161 Merge branch 'bug40911' into 'main'
Make two 1-bit fields unsigned

Closes #40911

See merge request tpo/core/tor!796
2024-02-08 19:41:22 +00:00
Sebastian Hahn
4c0e9f1418 Make two 1-bit fields unsigned
This should be a completely harmless warning as we only check whether
the fields are true or false.

Closes #40911.
2024-02-01 19:45:04 +01:00
Sebastian Hahn
4db6ab5c18 Update test strings 2024-02-01 17:16:17 +01:00
Sebastian Hahn
1abc9a3bd3 dirauth: Warn when failing to post during a vote
The only way to figure out that posting a vote or signatures to another
dirauth failed is by counting how many success messages there are on
notice level, and noticing that it is fewer than the number of
configured dirauths.

Closes #40910.
2024-02-01 10:34:30 +01:00
David Goulet
42215d6432 Merge branch 'tor-gitlab/mr/791' 2024-01-30 11:47:53 -05:00
Alexander Færøy
824a0c4665 Merge branch 'ticket40816_049_01' into 'main'
metrics: Add new relay metrics to MetricsPort

Closes #40816

See merge request tpo/core/tor!793
2024-01-30 16:24:55 +00:00
David Goulet
4a94d0394e Merge branch 'maint-0.4.8' 2024-01-30 10:57:02 -05:00
David Goulet
fbca1df9dd dirauth: Reject 0.4.7.x series at the authority level
Signed-off-by: David Goulet <dgoulet@torproject.org>
2024-01-30 10:56:16 -05:00
juga
56819b0a50 bwauth: Allow "node_id" KeyValue without "$"
Allow "node_id" KeyValue without the dollar sign at the start of the
hexdigit in the BandwidthFiles, in order to easier database queries
combining Tor documents in which the relays fingerprint doesn't
include it.
Bugfix on all supported versions of Tor.

Closes #40891
2024-01-30 10:47:13 -05:00
David Goulet
5a5ca444c8 metrics: Add new relay metrics to MetricsPort
This commit adds the total number of DROP cell seen, the total number of
DESTROY cell received and the total number of protocol violation that lead to a
circuit close.

Closes #40816

Signed-off-by: David Goulet <dgoulet@torproject.org>
2024-01-30 10:13:09 -05:00
nonameformee
50b564da18 dirauth: Reject 0.4.7.x series at the authority level 2023-12-10 10:36:48 +00:00
David Goulet
4d7ca89fc3 Merge branch 'maint-0.4.8' 2023-12-08 13:45:36 -05:00
Tor CI Release
4c97dc1626 fallbackdir: Update list generated on December 08, 2023 2023-12-08 13:45:00 -05:00
Tor CI Release
ad22b60ff1 Update geoip files to match ipfire location db, 2023/12/08. 2023-12-08 13:44:45 -05:00
David Goulet
64e6458c87 Merge branch 'maint-0.4.8' 2023-12-08 13:26:16 -05:00
David Goulet
6fbbcdde35 Merge remote-tracking branch 'mikeperry-private/bug40897' into maint-0.4.8 2023-12-08 13:19:40 -05:00
Alexander Færøy
ae11abfe92 Merge branch 'maint-0.4.8' 2023-12-07 21:38:32 +00:00
Alexander Færøy
1b1f6e8574 Merge remote-tracking branch 'origin/merge-requests/776' into maint-0.4.8 2023-12-07 21:38:03 +00:00
Mike Perry
cc52f7e5b7 Bug 40897 Bug Bounty: Double the number of max conflux circs
We strongly suspect that bug 40897 was caused by a custom Tor client that
tried to use more than the default number of conflux circuits, for either
performance or traffic analysis defense gains, or both.

This entity hit a safety check on the exit side, which caused a UAF. Our
"belt and suspenders" snapped off, and hit us in the face... again...

Since there are good reasons to try more than 2 conflux legs, and research has
found some traffic analysis benefits with as many as 5, we're going to raise
and parameterize this limit as a form of bug bounty for finding this UAF, so
that this entity can try out a little more confluxing.

This should also make it easier for researchers to try things like gathering
traces with larger amounts of confluxing than normal, to measure real-world
traffic analysis impacts of conflux.

Shine on, you yoloing anonymous diamond. Let us know if you find out anything
interesting!
2023-12-07 18:37:30 +00:00
Mike Perry
03778a0f34 Bug 40897: Add more checks to free paths
Similar double-frees would be caught earlier by these, so long as the pointers
remain nulled out.
2023-12-07 18:37:30 +00:00
Mike Perry
d02eb4502a Bug 40897: Move safety check to proper location and give it error handling. 2023-12-07 18:37:26 +00:00
David Goulet
d07810a3c9 Merge branch 'fix-bridge-exit-warn' into 'main'
Fix bridge exit warn

Closes #40884

See merge request tpo/core/tor!783
2023-11-22 15:02:14 +00:00
David Goulet
0ea2e15d84 Merge branch 'did-sanity-memmem' into 'main'
add sanity check in tor_memmem

Closes #40854

See merge request tpo/core/tor!785
2023-11-22 15:01:03 +00:00
Alexander Færøy
45c1a36acb Merge branch 'eol-config-no-spurious-warn' into 'main'
don't warn for empty RecommendedServerVersion

Closes #40888

See merge request tpo/core/tor!787
2023-11-21 18:04:38 +00:00
juga
d8aa699253 bwauth: Allow "node_id" KeyValue without "$"
Allow "node_id" KeyValue without the dollar sign at the start of the
hexdigit in the BandwidthFiles, in order to easier database queries
combining Tor documents in which the relays fingerprint doesn't
include it.
Bugfix on all supported versions of Tor.

Closes #40891
2023-11-21 10:43:36 -05:00
trinity-1686a
635220734d don't warn for empty RecommendedServerVersion 2023-11-16 19:15:25 +01:00
trinity-1686a
f2ddfdd50e add sanity check in tor_memmem
it's believed most libc already have those, but just in case, it can't
hurt
2023-11-15 02:01:34 +01:00
trinity-1686a
8fafdca11e
don't warn when ExitRelay is set to 0 2023-11-12 18:24:33 +01:00
David Goulet
7703c94756 Merge branch 'maint-0.4.8' 2023-11-09 09:24:22 -05:00
Tor CI Release
825aa705b1 fallbackdir: Update list generated on November 09, 2023 2023-11-09 09:23:59 -05:00
Tor CI Release
f822f24599 Update geoip files to match ipfire location db, 2023/11/09. 2023-11-09 09:23:54 -05:00
David Goulet
12723de00b Merge branch 'maint-0.4.8' 2023-11-09 09:17:51 -05:00
David Goulet
be751a46e3 Merge branch 'ticket40883_048_01' into maint-0.4.8 2023-11-09 09:14:19 -05:00
David Goulet
525a1cfb70 Merge branch 'maint-0.4.8' 2023-11-09 09:10:58 -05:00
David Goulet
6df27ae953 Merge branch 'tor-gitlab/mr/778' into maint-0.4.8 2023-11-09 09:10:52 -05:00
David Goulet
83aecca561 hs: Always check if the hs_ident is available when processing a cell
Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-11-08 11:17:48 -05:00
David Goulet
e62b8bce5a hs: Fix assert in hs_metrics_update_by_ident()
The hs_metrics_failed_rdv() macro could pass a NULL value for the identity key
when a building circuit would end up in a failure path *before* the "hs_ident"
was able to be set which leading to this assert.

This was introduced in 0.4.8.1-alpha with the addition of rendezvous circuit
failure metrics for the MetricsPort.

This fixes TROVE-2023-006 for which its severity is considered high.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-11-07 13:50:28 -05:00
David Goulet
8257cd10f3 Merge branch 'maint-0.4.8' 2023-11-03 09:41:12 -04:00
Tor CI Release
f1df34193b Update geoip files to match ipfire location db, 2023/11/03. 2023-11-03 09:38:29 -04:00
Tor CI Release
ea6d6568e7 fallbackdir: Update list generated on November 03, 2023 2023-11-03 09:38:21 -04:00
David Goulet
bd8915ad8d Merge branch 'maint-0.4.8' 2023-11-03 09:04:27 -04:00
David Goulet
24dc829b9a Merge branch 'maint-0.4.7' into maint-0.4.8 2023-11-03 09:04:27 -04:00
Alexander Færøy
7aa496a2e0 Fix TROVE-2023-004: Remote crash when compiled against OpenSSL
Fixes #40874

Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-11-03 08:52:38 -04:00
Mike Perry
6bfadc7a5d Bug 40876: Extra logging 2023-11-01 19:57:08 +00:00
Mike Perry
d7f14a54fb Bug 40876: Don't reduce primary list for temporary restrictions 2023-11-01 19:57:07 +00:00
David Goulet
7fe80138e3 Merge branch 'maint-0.4.8' 2023-10-30 13:46:20 -04:00
Mike Perry
d9e7759088 Bug 40878: Count a valid conflux linked cell as valid data
For vanguards addon.
2023-10-30 16:54:49 +00:00
trinity-1686a
798fe6c5ed
fix memory leak in dos stream for resolve requests 2023-10-29 19:16:49 +01:00
trinity-1686a
d3dadf51af
correctly parse consensus params for dos stream mitigation 2023-10-29 18:15:18 +01:00
trinity-1686a
eca9973e9e remove todos 2023-10-18 13:06:10 -04:00
trinity-1686a
0cf4966acf fix typos 2023-10-18 13:06:10 -04:00
trinity-1686a
f8b259c2fe add metrics for rejected BEGIN/RESOLVE 2023-10-18 13:06:04 -04:00
trinity-1686a
1b907d13bb add rate limit on BEGIN and RESOLVE cell per circuit 2023-10-18 13:06:04 -04:00
trinity-1686a
379fb329d9 add configuration and network parameters for stream dos mitigation 2023-10-18 13:06:04 -04:00
David Goulet
cc31724f40 Merge branch 'ticket40870_048_02' into 'main'
conflux: Flag set as in full teardown in the free path

Closes #40870

See merge request tpo/core/tor!777
2023-10-18 14:40:18 +00:00
David Goulet
a382337be6 conflux: Flag set as in full teardown in the free path
We suspect a shutdown race of some sort for which the full teardown is not
noticed during the close but should be during the free.

For that, we flag the conflux set as in full teardown (if so) in the free path
in case the close path didn't caught it.

Fixes #40870

Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-10-16 21:18:57 +00:00
trinity-1686a
efc7159e08
fix bridge transport statistics 2023-10-12 18:44:54 +02:00
David Goulet
a7b7989844 Merge branch 'eol-config' into 'main'
add configuration option to reject descriptor based on tor version

Closes #40817

See merge request tpo/core/tor!773
2023-10-12 14:36:33 +00:00
David Goulet
dad173d3be Merge branch 'metrics-count-bug' into 'main'
add metrics counter for BUG() reached

Closes #40839

See merge request tpo/core/tor!760
2023-10-11 18:59:34 +00:00
Nick Mathewson
8c22fd4a4d Fix the spelling of maxunmeasur(e)dbw.
This has been misspelled when using consensus method 31 or later
since 0.4.6.1-alpha.  Fixes bug 40869.

This commit is a backport of b9b0abd6c2 to 0.4.8.
2023-10-11 10:08:53 -04:00
trinity-1686a
a02eef2a19
reject MinimalAcceptedServerVersion which would reject current version
and fix memory leak on reload error path
2023-10-08 14:23:29 +02:00
trinity-1686a
6dfb48894f
introduce MinimalAcceptedServerVersion 2023-10-07 17:35:57 +02:00
Nick Mathewson
b9b0abd6c2 Fix the spelling of maxunmeasur(e)dbw.
This has been misspelled when using consensus method 31 or later
since 0.4.6.1-alpha.  Fixes bug 40869.
2023-10-05 23:28:05 -04:00
Nick Mathewson
5b80a8f509 Remove MIN_METHOD_FOR_MIDDLEONLY 2023-10-05 09:07:47 -04:00
Nick Mathewson
a62ea32246 Remove MIN_METHOD_FOR_CORRECT_BWWEIGHTSCALE
This also lets us discard extract_param_buggy, which we've been
wanting to do.
2023-10-05 09:07:47 -04:00
Nick Mathewson
940a4c7eaa Remove tests that checked for obsolete microdesc encoding. 2023-10-05 09:07:47 -04:00
Nick Mathewson
8ebb726d4d Remove MIN_METHOD_FOR_UNPADDED_NTOR_KEY 2023-10-05 09:07:47 -04:00
Nick Mathewson
a2ab949a13 Remove MIN_METHOD_FOR_CANONICAL_FAMILIES_IN_MICRODESCS 2023-10-05 09:07:47 -04:00
Nick Mathewson
a7993bbd72 Whoops: test the "wrong" name for maxunmeasurdbw (sic).
Now that we never use an earlier consensus method, our tests actually
hit this, and we find that we have misspelled "maxunmeasurdbw" (sic) in
dirvote.c.

I have opened ticket #40869 to track this misspelling.
2023-10-05 09:07:37 -04:00
Nick Mathewson
a937648022 Update consensus methods in dir_umbw tests.
These tests had previously listed methods that we no longer support.
2023-10-05 08:45:23 -04:00
Nick Mathewson
5edc59bfd1 Increment MIN_SUPPORTED_CONSENSUS_METHOD to 32.
Per proposal 290, all earlier consensus methods are obsolete, since 32 is the
highest method supported by 0.4.7.7.
2023-10-05 08:11:41 -04:00
David Goulet
d324c14a1f Merge branch 'maint-0.4.8' 2023-09-25 09:51:50 -04:00
Tor CI Release
f55e344601 fallbackdir: Update list generated on September 25, 2023 2023-09-25 09:51:25 -04:00
Tor CI Release
7675bd9be9 Update geoip files to match ipfire location db, 2023/09/25. 2023-09-25 09:51:25 -04:00
David Goulet
dec9a6946f Merge branch 'ahf/40638' into 'main'
Handle ntor and ntor_v3 individually in rephist and for MetricsPort.

Closes #40638

See merge request tpo/core/tor!767
2023-09-25 12:42:12 +00:00
David Goulet
0f84a5a626 Merge branch 'maint-0.4.8' 2023-09-21 08:59:02 -04:00
Mike Perry
d499de5813 Bug 40862: Check if circuits are unused more ways 2023-09-20 23:35:36 +00:00
Alexander Færøy
b855a786b6 Handle ntor and ntor_v3 individually in rephist and for MetricsPort.
This patch should not mess with the DoS protection here.

Fixes tpo/core/tor#40638.
2023-09-19 18:34:27 +02:00
Tor CI Release
d7777c121c version: Bump version to 0.4.7.15-dev 2023-09-18 10:57:35 -04:00
Tor CI Release
69fdf36dd1 version: Bump version to 0.4.7.15 2023-09-18 10:05:23 -04:00
David Goulet
160c8b89b3 Merge branch 'maint-0.4.8' 2023-09-18 09:52:00 -04:00
David Goulet
62c0f9ec79 Merge branch 'maint-0.4.7' into maint-0.4.8 2023-09-18 09:51:59 -04:00
Tor CI Release
4a11b4b95c fallbackdir: Update list generated on September 18, 2023 2023-09-18 09:51:12 -04:00
Tor CI Release
4fc5fe7f69 Update geoip files to match ipfire location db, 2023/09/18. 2023-09-18 09:51:07 -04:00