Commit Graph

28377 Commits

Author SHA1 Message Date
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
David Goulet
b064de3c68 Match fallbackdir with maint-0.4.8 for release
Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-09-18 09:40:27 -04:00
David Goulet
5e961007db geoip: Match maint-0.4.8 files for release
Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-09-18 09:27:20 -04:00
David Goulet
ca9ca6da04 Merge branch 'sandbox-aarch64-riscv-fixes' into 'main'
Fix sandbox on AArch64, RISC-V

Closes #24454

See merge request tpo/core/tor!446
2023-09-18 13:14:51 +00:00
David Goulet
7278c1554d Merge branch 'ahf/android-gp-fixes-bulk' into 'main'
Bulk Android path changes

Closes #40487

See merge request tpo/core/tor!762
2023-09-18 13:12:36 +00:00
David Goulet
8425e1e575 Merge branch 'maint-0.4.8' 2023-09-18 09:11:06 -04:00
David Goulet
2c8430cb2f Merge branch 'tor-gitlab/mr/759' into maint-0.4.8 2023-09-18 09:11:02 -04:00
David Goulet
fada3c0d02 Merge branch 'maint-0.4.8' 2023-09-18 09:10:44 -04:00
David Goulet
cd2bc94c44 Merge branch 'tor-gitlab/mr/761' into maint-0.4.8 2023-09-18 09:10:39 -04:00
David Goulet
ac6bd88912 Merge branch 'maint-0.4.8' 2023-09-18 09:08:17 -04:00
David Goulet
5a2f46a7ba Merge branch 'maint-0.4.7' into maint-0.4.8 2023-09-18 09:08:17 -04:00
David Goulet
c0a10b259c Merge branch 'tor-gitlab/mr/764' into maint-0.4.7 2023-09-18 09:08:13 -04:00
Alexander Færøy
3d160b37c2 Lower the log-level and soften the language for our Zstd ABI compat check.
See: tpo/core/tor#40815.
2023-09-14 22:26:41 +02:00
David Goulet
c884a07f08 Merge branch 'maint-0.4.8' 2023-09-14 15:34:26 -04:00
David Goulet
fff805c7dd Merge branch 'maint-0.4.7' into maint-0.4.8 2023-09-14 15:34:25 -04:00
Mike Perry
ee0797bf0e Bug 40858: Cache sendme_inc to avoid purging intro points.
Bug found and fixed by @hyunsoo.kim676.
2023-09-14 19:16:06 +00:00
Alexander Færøy
22f0246932 Merge remote-tracking branch 'upstream/merge-requests/493' into ahf/android-gp-fixes-bulk 2023-09-13 18:29:54 +02:00
Alexander Færøy
1cf796d3b4 Merge remote-tracking branch 'upstream/merge-requests/460' into ahf/android-gp-fixes-bulk 2023-09-13 18:29:38 +02:00
Alexander Færøy
d9a6b37ab1 Add diagnostic log message for compression bombs.
This patch causes `tor_compress_is_compression_bomb()` to emit a
warning-level log message that lets us learn the potential ratio of the
input to output buffer sizes. Hopefully, this will give us a bit of a
better idea whether the compression bomb ratio needs some tuning.

See: tpo/core/tor#40739.
2023-09-13 16:13:28 +02:00
trinity-1686a
effa9418ef
add metrics counter for BUG() reached 2023-09-12 23:10:13 +02:00
Alexander Færøy
87fb8b6417 Remove defensive assertion in relay_key_is_unavailable_().
This patch removes a call to `tor_assert_nonfatal_unreached()` in
`relay_key_is_unavailable_()` that is only called when Tor is compiled
without relay support.

Unfortunately, the non-fatal assertion causes a BUG log
message to appear for clients when they start up without relay support
for each CPU worker we spawn. This makes it spotting issues during
bootstrap harder particularly for our iOS developers.

Since the call sites to `get_master_identity_key()` handles `NULL`
values already, we do not think this will be an issue later on.

Reported by Benjamin Erhart (@tla) from Guardian Project.

Fixes tpo/core/tor#40848.
2023-09-12 16:42:35 +02:00
David Goulet
7f626f5577 Merge branch 'libressl-3.8.1' into 'main'
crypt_openssl_mgt: define DISABLE_ENGINES after OPENSSL_NO_ENGINE

See merge request tpo/core/tor!754
2023-09-12 14:32:03 +00:00
David Goulet
9f2d3e7750 Merge branch 'cell_comment' into 'main'
Correct a comment on channel_should_write_to_kernel.

See merge request tpo/core/tor!757
2023-09-12 14:31:08 +00:00
David Goulet
2cecf046bb Merge branch 'maint-0.4.8' 2023-09-12 10:28:42 -04:00
Nick Mathewson
d6c89b1ae1 Make networkstatus_getinfo_by_purpose report published_on again.
When we implemented prop275 in 0.4.8.1-alpha, we changed the
behavior of networkstatus_getinfo_helper_single to omit meaningful
published_on times, replacing them with "2038-01-01".  This is
necessary when we're formatting a routerstatus with no additional
info, since routerstatus objects no longer include a published_on.

But in networkstatus_getinfo_by_purpose, we do have a routerinfo
that does have a published_on.  This patch uses that information
to report published_on times in our output when we're making a
"virtual" networkstatus for a big file of routerinfo_t objects.
This is mostly important for bridge authorities, since when
they dump a secret list of the bridges, they want to include
published_on times.

Closes #40855. Bugfix on 0.4.8.1-alpha.
2023-09-12 08:46:31 -04:00
Nick Mathewson
1da5a9b3bc Correct a comment on channel_should_write_to_kernel.
This issue was originally called out by pseudonymisaTor on !707; the comment in
this commit takes a different approach to explaining what is going on.
2023-09-12 08:24:29 -04:00
Roger Dingledine
41f3296180 fix two simple typos in comments 2023-09-05 16:06:54 -04:00
orbea
48f8d69189 crypt_openssl_mgt: define DISABLE_ENGINES after OPENSSL_NO_ENGINE
With LibreSSL-3.8.1 these engines are no long available causing a build
failure, but LibreSSL correctly defines OPENSSL_NO_ENGINE as part of its
opensslfeatures.h. However Tor includes crypto_openssl_mgt.h before any
of the openssl includes which would define OPENSSL_NO_ENGINE and then
fails to define DISABLE_ENGINES.

As the define is used in only a single .c file it is best to move it
there.

Signed-off-by: orbea <orbea@riseup.net>
2023-08-31 14:38:15 -07:00
David Goulet
cc52d8651f Merge branch 'maint-0.4.8' 2023-08-30 08:49:51 -04:00
Tor CI Release
1f88c76848 fallbackdir: Update list generated on August 30, 2023 2023-08-30 08:47:17 -04:00
Tor CI Release
9254028b38 Update geoip files to match ipfire location db, 2023/08/30. 2023-08-30 08:47:12 -04:00
David Goulet
c8844bc929 Merge branch 'maint-0.4.8' 2023-08-28 14:08:43 -04:00
David Goulet
3aa937dd5e Merge branch 'tor-gitlab/mr/750' into maint-0.4.8 2023-08-28 14:08:39 -04:00
David Goulet
4a1815e4cb Merge branch 'maint-0.4.8' 2023-08-28 14:07:47 -04:00
Micah Elizabeth Scott
a3e7e9bda2 equix: Disable huge page support by default
Equi-X supports optionally allocating its solver memory using huge
pages, to reduce the virtual memory subsystem overhead required to make
the entire solver buffer live.

Tor doesn't use this feature, since it seems to have no noticeable
performance benefit at this time, but we still included code for it at
compile time. To improve portability, this patch disables huge page
support by default and enables it only in the cmake build system used
for equix benchmarks.

With this patch equix-bench still supports huge pages. Verified using
strace that we're making the hugepage allocation.

There's no fallback for huge pages, so Equi-X initialization will fail
if they are requested and we don't support them for any runtime or
compile-time reason.

Addresses #40843 (NetBSD) but also prevents future porting issues
related to huge pages.
2023-08-28 10:11:00 -07:00
Micah Elizabeth Scott
95e8ffa97e hashx: Fix compiled hash function on NetBSD
NetBSD includes the idea of a 'maximum protection' per-region,
and an mprotect which exceeds the max protection will be denied.

If we explicitly ask for a maximum which includes execute permission, we
can successfully swap our code buffer's permissions between read-write
and read-execute when each hash program is compiled.

With this patch, the crypto/hashx tests pass on NetBSD 9.
This addresses bug #40844
2023-08-28 10:11:00 -07:00
Micah Elizabeth Scott
ee4e9f7506 hashx: Avoid unused arg warning on OpenBSD and NetBSD
This path in hashx_vm_alloc_huge() for OpenBSD and NetBSD always
fails without checking its parameter. Fix the warning.
2023-08-28 10:11:00 -07:00
Micah Elizabeth Scott
9cac0a85b4 equix: Add NetBSD to "huge pages not supported" path
As suggested by @wiz on #40843, let's add an explicit check to
hashx_vm_alloc_huge() that avoids using a Linux-style default
on NetBSD targets.

This doesn't change the questionable Linux-style default,
but a future patch will disable this code by default so it's not a
portability liability.

(This code is in hashx's VM layer but it's actually only relevant to
equix.)

This addresses bug #40843. Another patch will disable huge pages
by default entirely, but this patch is sufficient to fix the NetBSD
build.
2023-08-28 10:11:00 -07:00
Mike Perry
7666dd777a Bug #40842: Additional diagnostics
Just in case there are other instances hiding in the maze.
2023-08-25 22:53:07 +00:00
Mike Perry
fd6f098c9d Bug #40842: Don't send on sets that are being torn down 2023-08-25 22:45:07 +00:00
David Goulet
aeb2e24a75 Merge branch 'maint-0.4.8' 2023-08-25 12:56:45 -04:00
David Goulet
4119a7f971 Merge branch 'tor-gitlab/mr/748' into maint-0.4.8 2023-08-25 12:56:42 -04:00
David Goulet
4f21fc0fe4 Merge branch 'reapply-exit-policy-on-reload' into 'main'
reapply exit policy on reload

Closes #40676

See merge request tpo/core/tor!735
2023-08-25 16:55:40 +00:00
David Goulet
99a19a0da6 Merge branch 'no_consensus_on_package_lines' into 'main'
Implement proposal 301-dont-vote-on-package-fingerprints.txt

See merge request tpo/core/tor!743
2023-08-25 16:54:54 +00:00
trinity-1686a
73930bda48 fix lint clippy::arc_with_non_send_sync 2023-08-25 12:53:17 -04:00
Mike Perry
380727a16d Bug #40841: Demote extra legs to protocol warn.
Also add more info to leg dump.
2023-08-25 16:32:59 +00:00
trinity-1686a
453c8b46d3 fix lint clippy::arc_with_non_send_sync 2023-08-25 10:30:03 +02:00
David Goulet
97d3cf3950 doxygen: Typo fix in relay.c comment
HTML in comment, what a bad idea...

Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-08-23 17:02:25 -04:00
David Goulet
c56ba686d6 typo: Fix a doxygen html unclosed tag
Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-08-23 16:41:36 -04:00
Tor CI Release
10636f84e8 fallbackdir: Update list generated on August 23, 2023 2023-08-23 09:21:47 -04:00
Tor CI Release
56008b623f Update geoip files to match ipfire location db, 2023/08/23. 2023-08-23 09:21:43 -04:00
David Goulet
c3bc04e355 Fix compilation errors for FreeBSD
Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-08-22 13:37:25 -04:00
David Goulet
c6b1da20a7 Merge remote-tracking branch 'mbeth-private/ticket40833_mr' 2023-08-22 13:24:00 -04:00
David Goulet
e39fb0962f Merge remote-tracking branch 'mbeth-private/ticket40821_mr' 2023-08-22 13:09:54 -04:00
Micah Elizabeth Scott
8991b10cac CI: Diagnostic for failure in test_rebind cleanup
I saw this test fail intermittently due to what seemed like a filesystem
race in docker? The cleanup task was failing with a 'directory not
empty' error, despite trying to do a recursive 'rm'. This patch adds an
'ls' to the same directory, hoping the output might be useful to
diagnose future intermittent failures.
2023-08-15 09:52:30 -07:00
Micah Elizabeth Scott
317a56c133 tor-c-equix: Fix clippy warning
Clippy found a transmute that could have been a reborrow.
2023-08-15 09:52:30 -07:00
David Goulet
00881f1886 Merge branch 'maint-0.4.7' 2023-08-15 12:39:33 -04:00
Mike Perry
a56434a82b Bug 40834: Remove assert and add logs to track no-leg case 2023-08-15 15:05:25 +00:00
Mike Perry
72164740a2 Revert "Nullify on_circuit if last conflux leg"
This reverts commit 5487476fd9.
2023-08-15 14:53:17 +00:00
Nick Mathewson
0cdd5a7900 Implement proposal 301-dont-vote-on-package-fingerprints.txt
This commit adds a new consensus method which, when present, causes
authorities not to consider package fingerprints when computing a
consensus. It builds on earlier work which dropped support for putting
these lines into the votes.
2023-08-15 10:12:25 -04:00
David Goulet
fd3f9e8580 zstd: Check errors right affer compressing/decompressing
Considering a compression bomb before looking for errors led to false negative
log warnings. Instead, it is possible the work failed for whatever reasons
which is not indicative of a compression bomb.

Fixes #40739

Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-08-14 11:05:23 -04:00
Micah Elizabeth Scott
d0343b12c6 test_dos: Fixes for uninitialized stack memory
This was causing CI failures that didn't reproduce on my local machine.
The DoS subsystem now has a new assert() which triggers a BUG on some
nonzero memory contents (or_conn->tracked_for_dos_mitigation), and
uninitialized stack memory might be nonzero.
2023-08-11 18:05:07 -07:00