Commit Graph

28450 Commits

Author SHA1 Message Date
David Goulet 717b59ac2b process: Don't close all FDs on new spawn
Fixes #40990

Signed-off-by: David Goulet <dgoulet@torproject.org>
2024-12-03 10:16:32 -05:00
David Goulet e5b51eb10f Revert "Rework of worker threads' start and exit + slight changes in cleanup code"
This reverts commit 4f3aafa1e4.

Once merged upstream, the CI failed here with:

Warning: Failed to confirm worker threads' start up after timeout.
Warning: Bug:     /builds/tpo/core/tor/build/src/app/tor(_start+0x2a) [0x56404d21ddaa] (on Tor 0.4.9.0-alpha-dev 4f3aafa1e4)
Warning: Bug:     /builds/tpo/core/tor/build/src/app/tor(cpuworker_init+0x53) [0x56404d373d53] (on Tor 0.4.9.0-alpha-dev 4f3aafa1e4)
Warning: Bug:     /builds/tpo/core/tor/build/src/app/tor(log_backtrace_impl+0x57) [0x56404d29e1f7] (on Tor 0.4.9.0-alpha-dev 4f3aafa1e4)
Warning: Bug:     /builds/tpo/core/tor/build/src/app/tor(main+0x19) [0x56404d21dd59] (on Tor 0.4.9.0-alpha-dev 4f3aafa1e4)
Warning: Bug:     /builds/tpo/core/tor/build/src/app/tor(run_tor_main_loop+0xce) [0x56404d22188e] (on Tor 0.4.9.0-alpha-dev 4f3aafa1e4)
Warning: Bug:     /builds/tpo/core/tor/build/src/app/tor(threadpool_new+0x295) [0x56404d3e28f5] (on Tor 0.4.9.0-alpha-dev 4f3aafa1e4)
Warning: Bug:     /builds/tpo/core/tor/build/src/app/tor(tor_assertion_failed_+0x148) [0x56404d2a9248] (on Tor 0.4.9.0-alpha-dev 4f3aafa1e4)
Warning: Bug:     /builds/tpo/core/tor/build/src/app/tor(tor_main+0x49) [0x56404d21e179] (on Tor 0.4.9.0-alpha-dev 4f3aafa1e4)
Warning: Bug:     /builds/tpo/core/tor/build/src/app/tor(tor_run_main+0x1e5) [0x56404d221db5] (on Tor 0.4.9.0-alpha-dev 4f3aafa1e4)
Warning: Bug:     /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xea) [0x7f6aa3b1cd7a] (on Tor 0.4.9.0-alpha-dev 4f3aafa1e4)
Warning: Bug: Tor 0.4.9.0-alpha-dev (git-4f3aafa1e422e9aa): Assertion 0 failed in threadpool_new at /builds/tpo/core/tor/src/lib/evloop/workqueue.c:641: . Stack trace: (on Tor 0.4.9.0-alpha-dev 4f3aafa1e4)

We are figuring it out but revert this so we can release an alpha.
2024-12-03 10:06:25 -05:00
Waldemar Zimpel 4f3aafa1e4 Rework of worker threads' start and exit + slight changes in cleanup code
See issue #40991
2024-12-03 09:20:15 -05:00
David Goulet 9b03f0288a Merge branch 'maint-0.4.8' 2024-10-31 08:37:51 -04:00
Waldemar Zimpel 4759350b9a Fix: Use FREE_AND_NULL() for releasing workqueue resources
See issue #40989
2024-10-31 08:37:37 -04:00
Roger Dingledine 9cb7a19e22 whitespace fix while debugging #40981 2024-10-24 18:55:29 -04:00
David Goulet 0567401805 Merge branch 'maint-0.4.8' 2024-10-24 10:33:31 -04:00
Tor CI Release 200e89ee69 fallbackdir: Update list generated on October 24, 2024 2024-10-24 10:32:45 -04:00
Tor CI Release dd9c6a4992 Update geoip files to match ipfire location db, 2024/10/24. 2024-10-24 10:30:55 -04:00
David Goulet 26c069089b Revert "Handle empty DNS reply without error as NOERROR"
Closes #40984

This reverts commit 3d2f7c3467.
2024-10-21 12:03:54 -04:00
David Goulet 8f43b97895 Merge branch 'maint-0.4.8' 2024-10-16 09:05:34 -04:00
Roger Dingledine 7cca6dc1a3 don't build preemptive conflux circuits if no predicted ports
Conflux circuit building was ignoring the "predicted ports" feature,
which aims to make Tor stop building circuits if there have been
no user requests lately. This bug led to every idle Tor on the
network building and discarding circuits every 30 seconds, which
added overall load to the network, used bandwidth and battery from
clients that weren't actively using their Tor, and kept sockets open
on guards which added connection padding essentially forever.

Bug went in on commit 39c2927d when we added preemptive conflux circuit
pools.

Fixes bug 40981; bugfix on 0.4.8.1-alpha.
2024-10-15 15:59:25 -04:00
Daniel Winzen 6ea640dfc2 Create socket with correct family as given by sockshost 2024-10-13 22:32:56 +02:00
David Goulet 0577b630e1 Merge branch 'maint-0.4.8' 2024-10-10 09:55:57 -04:00
Waldemar Zimpel 6feaea8fa4 Fix: Memory leaks in cpuworker on shutdown
Resources allocated by cpuworker weren't being freed on clean shutdown.
This applies for worker threads, worker thread pool, reply queue, reply
event, ...
2024-10-10 09:55:46 -04:00
David Goulet 7383d462fb Merge branch 'empty-dns' into 'main'
Handle empty DNS reply without error as NOERROR

Closes #40248

See merge request tpo/core/tor!830
2024-10-10 13:22:23 +00:00
Cecylia Bocovich 1da650adb4 Fix unit test in test_entrynodes.c 2024-09-24 16:13:29 -04:00
Daniel Winzen 3d2f7c3467 Handle empty DNS reply without error as NOERROR 2024-09-24 15:07:59 +02:00
David Goulet a56350abc8 Merge branch 'typo-socks-proxy' into 'main'
Fix a typo in the HTTP proxy error message.

See merge request tpo/core/tor!829
2024-09-10 12:49:51 +00:00
David Goulet f909c86fc0 test: Add unit tests for prop351
Signed-off-by: David Goulet <dgoulet@torproject.org>
2024-09-10 08:46:02 -04:00
Pier Angelo Vendrame 7cb6e04acb Fix a typo in the HTTP proxy error message. 2024-09-10 14:24:46 +02:00
Nick Mathewson 3dfbacc7b6 Implement proposal 351
This proposal adds new syntax to the SOCKS5 username/password extension scheme,
so that requests with usernames starting with <torS0X> are now reserved.

For C tor, all we need to do is reject every username starting with <torS0X>
unless it is exactly "<torS0X>0".
2024-09-09 17:00:50 -04:00
David Goulet 17a70ab7c5 Merge branch 'maint-0.4.8' 2024-08-05 15:26:38 -04:00
David Goulet 93df26b11a dirvote: Fix memleak when computing consensus
Fixes #40966

Signed-off-by: David Goulet <dgoulet@torproject.org>
2024-08-05 11:59:30 -04:00
Nick Mathewson 6c8b93538c Do not publish TAP key when publish-dummy-tap-key is 0. 2024-06-26 11:42:36 -04:00
Nick Mathewson 9466cc9fdc Update supported protovers for prop350
Relay=1 is no longer supported; it corresponds to TAP.

Microdesc=3 and Desc=3 are now supported; they correspond to the ability to
handle (micro)descriptors without TAP onion keys.
2024-06-26 11:42:36 -04:00
Nick Mathewson ff66aa306b Add a test for parsing a routerdesc with no TAP key. 2024-06-26 11:42:36 -04:00
Nick Mathewson 71ca75cb19 Add a test for a microdesc with no onion key. 2024-06-26 11:42:36 -04:00
Nick Mathewson 48c1bebd9e Remove a now-unused variable. 2024-06-26 11:42:36 -04:00
Nick Mathewson 37f95e8dd2 process_descs: Authorities require TAP keys for now. 2024-06-26 11:42:36 -04:00
Nick Mathewson 73b73c07e1 Routerparse: accept routerdescs without TAP keys. 2024-06-26 11:42:36 -04:00
Nick Mathewson 6c3dd44762 routerparse: Simplify checking for now-mandatory elements
All of these elements are now mandatory, so we can now simplify
our logic for making sure that they are all present or all not-present.
2024-06-26 11:42:36 -04:00
Nick Mathewson 4cdf56a173 Rename "onion_pkey" fields in routerinfo_t, and make them optional.
(Renaming them has forced me to look at every place where they are used, so I
can make sure that they are really optional now.)
2024-06-26 11:42:36 -04:00
Nick Mathewson cbbfb812a8 Remove node_get_rsa_onion_key 2024-06-26 11:42:36 -04:00
Nick Mathewson 0428aef13a Remove TAP key from extend_info_t 2024-06-26 11:42:36 -04:00
Nick Mathewson 07f0a2b964 Make onion-key body optional in microdescs
Also, stop storing onion keys in microdesc_t.

(In prop350, for microdescs, we are making the body optional; the "onion-key"
entry is still mandatory, so that we can tell where microdescs begin.)
2024-06-24 17:48:55 -04:00
Nick Mathewson f631145cbf Remove support for deciding to use CREATE/EXTEND/TAP. 2024-06-24 13:54:26 -04:00
Nick Mathewson f6f2d5c4a0 prop350: Remove all support for TAP, CREATE, and EXTEND. 2024-06-24 13:51:54 -04:00
Nick Mathewson a696559d78 prop350: Stop accepting CREATE and EXTEND. 2024-06-24 13:29:04 -04:00
David Goulet ef05979587 Merge branch 'maint-0.4.8' 2024-06-18 15:19:12 -04:00
David Goulet d587ba01a7 bridge: Always put transport-info line
Signed-off-by: David Goulet <dgoulet@torproject.org>
2024-06-18 15:15:32 -04:00
Alexander Færøy 1941f25f4c Clean-up Managed Proxy state in PT tests.
This patch makes sure we clean up our version and implementation fields
in our Managed Proxy struct after each test run.

This was detected by LeakSanitizer.

See: tpo/core/tor#11101.
2024-06-18 15:15:32 -04:00
Alexander Færøy 3c8035b452 Add changes file for tpo/core/tor#11101. 2024-06-18 15:15:32 -04:00
Alexander Færøy b4f8518f8f Add implementation and version metadata to bridge extra-info.
This patch adds two new keys to bridges' extra-info document:
"transport-version" and "transport-implementation".

These two new values always appear together (if one is missing, the
other one will be missing too) and is parsed from PT's STATUS
TYPE=version messages.

See: tpo/core/tor#11101.
2024-06-18 15:15:20 -04:00
Alexander Færøy f459344488 Include "IMPLEMENTATION" parameter to STATUS TYPE=version PT messages. 2024-06-18 15:15:20 -04:00
Alexander Færøy d27ce6b8f0 Drop requirement for TRANSPORT being present in STATUS messages. 2024-06-18 15:15:20 -04:00
Alexander Færøy b6e260e699 Add support for PT STATUS TYPE=version messages.
This patch adds support for handling the version status message. Once we
receive such message, we add the given version string to the
managed_proxy_t instance. Note this value can be NULL and the value can
change throughout the lifetime of the PT as multiple status version
messages are handled.

See: tpo/core/tor#11101
2024-06-18 15:15:20 -04:00
Peter Palfrader 48b354e038 fix sandbox for bandwidth authority 2024-06-07 19:38:10 +02:00
David Goulet bf9d2d3b89 Merge branch 'maint-0.4.8' 2024-06-06 08:56:54 -04:00
Tor CI Release 31f8b43e2d fallbackdir: Update list generated on June 06, 2024 2024-06-06 08:45:09 -04:00