Commit Graph

27646 Commits

Author SHA1 Message Date
Nick Mathewson
15ede0435f Lower maximum value for guard-extreme-restriction-percent to 100.
Values greater than 100 would have had the same effect as 100, so
this doesn't actually change Tor's behavior; it just makes the
intent clearer.  Fixes #40486; see also torspec#66.
2021-10-14 12:39:05 -04:00
Nick Mathewson
d10ceb7165 Downgrade "Rejecting RENDEZVOUS1 cell with unrecognized cookie"
This is the loudest of our LOG_PROTOCOL_WARN messages, it can occur
naturally, and there doesn't seem to be a great response to it.

Partial fix for 40400; bugfix on 0.1.1.13-alpha.
2021-10-14 12:21:30 -04:00
David Goulet
e0a6a0d085 hs: Fix memory leak if service failed to configure
Closes #40484

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-14 10:15:16 -04:00
Alexander Færøy
c81901fd39 Merge remote-tracking branch 'tor-gitlab/mr/433' into main 2021-10-14 13:01:41 +00:00
Alexander Færøy
d3c8008660 Merge remote-tracking branch 'tor-gitlab/mr/451' into main 2021-10-14 12:59:25 +00:00
David Goulet
4dfc5de509 Merge branch 'tor-gitlab/mr/455' 2021-10-14 08:40:38 -04:00
Nick Mathewson
3da455de00 Downgrade a PROTOCOL_WARN log message.
This one happens every time we get a failure from
circuit_receive_relay_cell -- but for all the relevant failing cases
in that function, we already log in that function.

This resolves one case of #40400.  Two cases remain.
2021-10-13 16:51:46 -04:00
Alexander Færøy
028b52f1ef Remove unused debugging code used for tor#17659
See: tpo/core/tor#17659
2021-10-11 21:29:49 +02:00
David Goulet
0f7e0d5f2f dirauth: Reject EOL relays
Series 0.4.2.x, 0.4.3.x and 0.4.4.x will all be rejected at the
authority level at this commit.

Futhermore, the 0.4.5.x alphas and rc will also be rejected.

Closes #40480

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-08 11:09:33 -04:00
David Goulet
ba5a71b913 Merge branch 'tor-gitlab/mr/447' 2021-10-08 10:43:53 -04:00
David Goulet
adcb094cb6 Merge branch 'tor-gitlab/mr/392' into maint-0.4.5 2021-10-06 15:45:13 -04:00
David Goulet
065ebd10c2 Merge branch 'tor-gitlab/mr/393' into maint-0.4.5 2021-10-06 15:41:12 -04:00
David Goulet
474c85a98d Merge branch 'maint-0.4.5' into maint-0.4.6 2021-10-06 15:35:43 -04:00
David Goulet
a53c949dcf Merge branch 'tor-gitlab/mr/420' into maint-0.4.5 2021-10-06 15:35:30 -04:00
David Goulet
d0d3b028d5 Remove last artifacts of Rust related code
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-06 15:12:04 -04:00
David Goulet
ae9042abbf rust: Remove Rust support from tree
Closes #40469

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-06 15:12:04 -04:00
David Goulet
c3e50f0fde Merge branch 'maint-0.4.6' 2021-10-06 13:25:08 -04:00
David Goulet
602dcd8e37 hs-v2: Only log once the connection warning to v2
Closes #40474

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-06 13:22:02 -04:00
David Goulet
f0d1240a07 hs-v2: Only log once the connection warning to v2
Closes #40474

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-06 13:20:22 -04:00
David Goulet
cdbf756b90 cc: Fix 32bit arithmetic to actually be 64bit
Coverity report: CID 1492322

________________________________________________________________________________________________________
*** CID 1492322:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/src/core/or/congestion_control_flow.c: 399 in circuit_process_stream_xon()
393       }
394
395       log_info(LD_EDGE, "Got XON: %d", xon->kbps_ewma);
396
397       /* Adjust the token bucket of this edge connection with the drain rate in
398        * the XON. Rate is in bytes from kilobit (kpbs). */
>>>     CID 1492322:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
>>>     Potentially overflowing expression "xon_cell_get_kbps_ewma(xon) * 1000U" with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "uint64_t" (64 bits, unsigned).
399       uint64_t rate = xon_cell_get_kbps_ewma(xon) * 1000;
400       if (rate == 0 || INT32_MAX < rate) {
401         /* No rate. */
402         rate = INT32_MAX;
403       }
404       token_bucket_rw_adjust(&conn->bucket, (uint32_t) rate, (uint32_t) rate);

Fixes #40478

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-05 13:47:49 -04:00
c
6ada3be8f1 net: Reject invalid characters in port ranges
Fixes issue #22469 where port strings such as '0x00' get accepted, not
because the string gets converted to hex, but because the string is
silently truncated past the invalid character 'x'. This also causes
issues for strings such as '0x01-0x02' which look like a hex port range,
but in reality gets truncated to '0', which is definitely not what a
user intends.

Warn and reject such port strings as invalid.

Also, since we're throwing that "malformed port" warning a lot in the
function, wrap it up in a nice goto.

Fixes #22469
2021-10-04 15:19:16 -04:00
David Goulet
e4e88c4b2e Merge branch 'tor-gitlab/mr/228' 2021-10-04 14:59:04 -04:00
David Goulet
4046b9f3ee edge: Remove wrong bug warn when processing pending streams
The connection_ap_attach_pending() function processes all pending
streams in the pending_entry_connections list. It first copy the pointer
and then allocates a brand new empty list.

It then iterates over that copy pointer to try to attach entry
connections onto any fitting circuits using
connection_ap_handshake_attach_circuit().

That very function, for onion service, can lead to flagging _all_
streams of the same onion service to be put in state RENDDESC_WAIT from
CIRCUIT_WAIT. By doing so, it also tries to remove them from the
pending_entry_connections but at that point it is already empty.

Problem is that the we are iterating over the previous
pending_entry_connections which contains the streams that have just
changed state and are no longer in CIRCUIT_WAIT.

This lead to this bug warning occuring a lot on busy services:

  May 01 08:55:43.000 [warn] connection_ap_attach_pending(): Bug:
  0x55d8764ae550 is no longer in circuit_wait. Its current state is
  waiting for rendezvous desc. Why is it on pending_entry_connections?
  (on Tor 0.4.4.0-alpha-dev )

This fix is minimal and basically allow a state to be not CIRCUIT_WAIT
and move on to the next one without logging a warning. Because the
pending_entry_connections is emptied before processing, there is no
chance for a streams to be stuck there forever thus it is OK to ignore
streams not in the right state.

Fixes #34083

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-04 14:11:18 -04:00
David Goulet
1873d4c14c Merge branch 'tor-gitlab/mr/444' 2021-10-04 10:49:27 -04:00
David Goulet
bfd69655af cc: Add comments and clean up some syntax
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-04 10:45:50 -04:00
Mike Perry
322f213210 Turn cell queue watermark limits into consensus params.
This allows us to have quicker reaction to blocked orconns as
a congestion signal.
2021-10-04 10:45:46 -04:00
Mike Perry
e9038dc5f2 Add a max cwnd consensus parameter and clamp. 2021-10-04 10:45:46 -04:00
Mike Perry
6dae9903b1 Turn orconn watermarks into consensus parameters.
Tuning these may reduce memory usage and latency.
2021-10-04 10:45:46 -04:00
Mike Perry
98be8634fa Turn CircEWMA tick len into consensus parameter.
This will assist tuning of CircEWMA in Shadow and Live.
2021-10-04 10:45:46 -04:00
Mike Perry
5e17f8acab Support time-based half-closed connection handling.
Since we no longer use stream SENDMEs for congestion control, we must now use
time to decide when data should stop arriving on a half-closed stream.
2021-10-04 10:45:46 -04:00
David Goulet
bd0aabe20f oom: Consider edge connections as well
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-04 10:45:46 -04:00
Mike Perry
58aca27265 MAKEFILE: Add flow control files to makefile 2021-10-04 10:45:46 -04:00
Mike Perry
0422eb26a7 Prop#324: Hook up flow control 2021-10-04 10:45:46 -04:00
Mike Perry
a89a71cd7b Prop#324: Stream flow control functions 2021-10-04 10:45:46 -04:00
David Goulet
0b376a9e82 trace: Add congestion control BDP update tracepoints
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-04 10:45:46 -04:00
David Goulet
896c16c3b1 Add lttng trace support.
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-04 10:45:46 -04:00
David Goulet
819b69244a Support rate limiting of edge connections reads.
We only need to rate limit reading on edges for flow control, as per the rate
that comes in the XON from the other side. When we rate limit reading from the
edge source to this rate, we will only deliver that fast to the other side,
thus satisfying its rate request.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-04 10:45:46 -04:00
Mike Perry
ca7f5c05a6 Prop#324: Add fields to edge connection. 2021-10-04 10:45:46 -04:00
David Goulet
ef7a64e3b8 hs-v2: Disable version 2 HSPOST and HSFETCH command
Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-09-30 11:18:08 -04:00
David Goulet
59bae7cbee hs-v2: Disable version 2 directory
Relay do not accept both stores and lookups of version 2 descriptor.
This effectively disable version 2 HSDir supports for relays.

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-09-30 10:46:17 -04:00
David Goulet
ff3ac02702 hs-v2: Disable version 2 introduction point
Upon receiving a v2 introduction request, the relay will close the
circuit and send back a tor protocol error.

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-09-30 10:40:19 -04:00
David Goulet
765bdb9c33 hs-v2: Disable version 2 service
The minimum service version is raised from 2 to 3 which effectively
disable loading or creating an onion service v2.

As for ADD_ONION, for version 2, a 551 error is returned:

  "551 Failed to add Onion Service"

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-09-30 10:38:08 -04:00
David Goulet
13b2b1108f hs-v2: Disable SOCKS connection for v2 addresses
This effectively turns off the ability of tor to use HSv2 as a client by
invalidating the v2 onion hostname passed through a SOCKS request.

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-09-30 10:26:37 -04:00
Mike Perry
33d8974f4d Export the n_ewma function for flow control use. 2021-09-28 21:39:36 +00:00
Mike Perry
8f9cf1ec43 Export a global notion of monotime clock stall/jump.
Monotime clock functionality is a global property, and flow control
also needs to know if it can trust the clock.
2021-09-28 21:39:36 +00:00
Mike Perry
6868f30ced Add trunnel definitions for xon/xoff cells. 2021-09-28 21:26:10 +00:00
Simon South
1a10948260 test: Add sandbox unit tests 2021-09-28 11:06:52 -04:00
Simon South
fbf2e7e921 sandbox: Allow use with fragile hardening
When building with --enable-fragile-hardening, add or relax Linux
seccomp rules to allow AddressSanitizer to execute normally if the
process terminates with the sandbox active.

Further resolves issue 11477.
2021-09-28 11:06:50 -04:00
Neel Chauhan
b7992d4f79 bwauth: Add AuthDirDontVoteOnDirAuthBandwidth option to avoid giving weights to dirauths 2021-09-27 08:58:00 -07:00
David Goulet
927f9a12a6 Bump version to 0.4.7.1-alpha
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-09-17 09:42:45 -04:00
Alexander Færøy
fcef8e3f75 Only check for bindable ports if we are unsure if it will fail.
We currently assume that the only way for Tor to listen on ports in the
privileged port range (1 to 1023), on Linux, is if we are granted the
NET_BIND_SERVICE capability. Today on Linux, it's possible to specify
the beginning of the unprivileged port range using a sysctl
configuration option. Docker (and thus the CI service Tor uses) recently
changed this sysctl value to 0, which causes our tests to fail as they
assume that we should NOT be able to bind to a privileged port *without*
the NET_BIND_SERVICE capability.

In this patch, we read the value of the sysctl value via the /proc/sys/
filesystem iff it's present, otherwise we assume the default
unprivileged port range begins at port 1024.

See: tor#40275
2021-09-13 18:33:27 +02:00
Daniel Pinto
7a06b8713d Fix compilation error when __NR_time is not defined. #40465 2021-09-09 23:55:49 +01:00
Guinness
83a11f8a76
Fix the line length in the patch 2021-09-09 13:59:33 +02:00
David Goulet
fe6898157c Merge branch 'tor-gitlab/mr/424' 2021-08-31 11:08:18 -04:00
Neel Chauhan
8ead53330c Add spaces between the "and" when logging the "Your server has not managed to confirm reachability for its" on dual-stack relays 2021-08-26 13:40:53 -07:00
Nick Mathewson
a36391f9c0 Add reference implementation for ntor v3. 2021-08-26 15:09:56 -04:00
Nick Mathewson
088c0367a2 Initial backend for an ntor-v3 implementation.
This code is based directly on the specification, without looking at
the reference implementation or the implementation in Arti.
Nonetheless, it is now passing with the test vectors generated by
the reference implementation.
2021-08-26 15:09:56 -04:00
Nick Mathewson
984e3a9c6c Merge remote-tracking branch 'tor-gitlab/mr/420' 2021-08-18 08:43:31 -04:00
David Goulet
cac612af42 dir: Do not flag non-running failing HSDir
When a directory request fails, we flag the relay as non Running so we
don't use it anymore.

This can be problematic with onion services because there are cases
where a tor instance could have a lot of services, ephemeral ones, and
keeps failing to upload descriptors, let say due to a bad network, and
thus flag a lot of nodes as non Running which then in turn can not be
used for circuit building.

This commit makes it that we never flag nodes as non Running on a onion
service directory request (upload or fetch) failure as to keep the
hashring intact and not affect other parts of tor.

Fortunately, the onion service hashring is _not_ selected by looking at
the Running flag but since we do a 3-hop circuit to the HSDir, other
services on the same instance can influence each other by removing nodes
from the consensus for path selection.

This was made apparent with a small network that ran out of nodes to
used due to rapid succession of onion services uploading and failing.
See #40434 for details.

Fixes #40434

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-08-17 13:27:14 -04:00
Alexander Færøy
168ea275b8 Merge branch 'maint-0.4.6' into main 2021-08-16 15:28:22 +00:00
Alexander Færøy
46ad2240de Merge branch 'maint-0.4.5' into maint-0.4.6 2021-08-16 15:28:22 +00:00
Alexander Færøy
903c578119 Always teardown capture of logs in CAPTURE().
This will hopefully solve an issue where our gmtime related tests are
failing on 32-bit builds.
2021-08-16 15:27:38 +00:00
Nick Mathewson
b2c4ac09d4 Merge branch 'maint-0.4.6' 2021-08-16 09:51:27 -04:00
Nick Mathewson
6a01c34bb8 Merge branch 'maint-0.4.5' into maint-0.4.6 2021-08-16 09:51:27 -04:00
Nick Mathewson
b2d6fed3e9 Disable message checking for some 32-bit tests about timegm failure.
Since we merged 40383, we don't expect these to give the same
warning on every platform.
2021-08-16 09:48:08 -04:00
Nick Mathewson
fd38609ae2 Make the version 0.4.6.7, not 0.4.6.7-dev. 2021-08-16 08:21:04 -04:00
Nick Mathewson
1ec4c7b34a Make the version 0.4.5.10, not 0.4.5.10-dev. 2021-08-16 08:18:57 -04:00
Nick Mathewson
2984fba97a Make the version 0.3.6.16, not 0.3.6.16-dev. 2021-08-16 08:17:59 -04:00
David Goulet
041a0a362f Update version to 0.3.5.16
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-08-13 09:43:44 -04:00
David Goulet
685b3e4383 Update version to 0.4.5.10
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-08-13 09:42:52 -04:00
David Goulet
07c417b207 Update version to 0.4.6.7
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-08-13 09:42:26 -04:00
David Goulet
4252744788 Merge branch 'maint-0.4.6' 2021-08-12 12:13:26 -04:00
David Goulet
4c3c40e70c Merge branch 'maint-0.4.5' into maint-0.4.6 2021-08-12 12:13:26 -04:00
David Goulet
33abeeab94 Merge branch 'maint-0.3.5' into maint-0.4.5 2021-08-12 12:13:25 -04:00
Alexander Færøy
eca5b62213 Update GeoIP files to match IPFire location DB as per 2021/08/12. 2021-08-12 15:38:11 +00:00
Alexander Færøy
2160697d14 Merge branch 'maint-0.4.6' into main 2021-08-11 13:15:59 +00:00
Alexander Færøy
b8660e384f Merge branch 'maint-0.4.5' into maint-0.4.6 2021-08-11 13:15:59 +00:00
Alexander Færøy
81635ec577 Merge branch 'maint-0.3.5' into maint-0.4.5 2021-08-11 13:15:58 +00:00
Alexander Færøy
7e0971d868 Merge remote-tracking branch 'tor-gitlab/mr/417' into maint-0.3.5 2021-08-11 13:15:35 +00:00
Alexander Færøy
ac254d5334 Merge branch 'maint-0.4.6' into main 2021-08-11 13:14:26 +00:00
Alexander Færøy
e3c2179f25 Merge branch 'maint-0.4.5' into maint-0.4.6 2021-08-11 13:14:26 +00:00
Alexander Færøy
c48d1c3f7c Merge branch 'maint-0.3.5' into maint-0.4.5 2021-08-11 13:14:26 +00:00
George Kadianakis
fe5a9db1e6 Disable ed25519-donna's batch verification.
Fixes bug 40078.

As reported by hdevalence our batch verification logic can cause an assert
crash.

The assert happens because when the batch verification of ed25519-donna fails,
the code in `ed25519_checksig_batch()` falls back to doing a single
verification for each signature.

The crash occurs because batch verification failed, but then all signatures
individually verified just fine.

That's because batch verification and single verification use a different
equation which means that there are sigs that can pass single verification
but fail batch verification.

Fixing this would require modding ed25519-donna which is not in scope for
this ticket, and will be soon deprecated in favor of arti and
ed25519-dalek, so my branch instead removes batch verification.
2021-08-11 13:14:05 +00:00
David Goulet
0e60b65f6c fallbackdir: Regenerate list
New list for all stable releases.

Closes #40447

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-08-11 09:07:05 -04:00
David Goulet
399518da02 relay: Reduce streaming compression ratio from HIGH to LOW
Fixes #40301

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-08-11 12:51:32 +00:00
David Goulet
70d8fb3eab relay: Reduce streaming compression ratio from HIGH to LOW
Fixes #40301

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-08-11 12:47:20 +00:00
Mike Perry
5c3021be85 Make inbuf and outbuf len check params const 2021-07-30 12:57:31 -04:00
Mike Perry
a0368b3759 MAKEFILE: include new CC algs in makefile 2021-07-30 12:57:31 -04:00
Mike Perry
ed1e91ffc2 TOR_NOLA: Implement a pure BDP tracking CC alg
How come no one ever named a congestion control algorithm after New Orleans?
2021-07-30 12:57:31 -04:00
Mike Perry
663cd052b5 TOR_VEGAS: Implement Prop#324 TOR_VEGAS. 2021-07-30 12:57:30 -04:00
Mike Perry
33cd92922a TOR_WESTWOOD: Implement Prop#324 TOR_WESTWOOD 2021-07-30 12:57:30 -04:00
Mike Perry
66f975e4e6 Prop#324: Free congestion control object on circ and cpath 2021-07-30 12:57:30 -04:00
Mike Perry
4d8c6d5701 Prop#324: Hook up CC window checks for relay cell packaging 2021-07-30 12:57:30 -04:00
Mike Perry
31fc7591a1 Prop#324: Hook up CC algs to main sendme callpoints 2021-07-30 12:57:30 -04:00
Mike Perry
802d7e22c5 Prop#324: Add congestion control state to structs 2021-07-30 12:57:30 -04:00
Mike Perry
f1d0c2d826 Prop#324: Common RTT, BDP, and blocked channel signal support 2021-07-30 12:57:30 -04:00
George Kadianakis
4f68fe3e6c Merge branch 'vanguards-lite-dev-rebased' 2021-07-28 12:00:37 +03:00
George Kadianakis
72aa23a9fd circpad: Be smarter on when to send back STOP cells. 2021-07-22 15:03:56 +03:00
George Kadianakis
30a97d9bb3 Increase frequency of vg-lite callback to 15 minutes 2021-07-20 13:03:32 +03:00
Nick Mathewson
27d6b3ae7a Remove some needless includes 2021-07-12 15:53:56 -04:00
Nick Mathewson
c63541a0b0 Remove fuzz_hexdigest.c: It is already covered by other fuzzers 2021-07-12 15:42:32 -04:00
Nick Mathewson
45bb6ae60b Merge remote-tracking branch 'tor-gitlab/mr/407' 2021-07-12 15:41:12 -04:00
Nick Mathewson
a11a9bb3a0 test_hs_ob: initialize pointers to NULL
This is an attempt to fix CID 1486280, where coverity warns us that,
if the tests failed, we might free() an uninitialized pointer.
2021-07-12 15:04:43 -04:00
Nick Mathewson
1d9de2948b test_hs_control: initialize pointers to NULL
This is an attempt to fix CID 1486276, where coverity warns us that,
if the tests failed, we might free() an uninitialized pointer.
2021-07-12 14:59:29 -04:00
George Kadianakis
5949a70b58 Add stricter limits to the number of L2 nodes 2021-07-12 12:27:25 +03:00
George Kadianakis
7f701794e7 Add a switch to toggle the feature on/off 2021-07-12 12:22:58 +03:00
George Kadianakis
7ec9a68477 Service intro circuits are now 4-hop to avoid linkability by intro
Now the circuits look like this:

	 client rend:   C -> G -> L2 -> Rend
	 client intro:  C -> G -> L2 -> M -> Intro
	 client hsdir:  C -> G -> L2 -> M -> HSDir
	 service rend:  C -> G -> L2 -> M -> Rend
	 service intro: C -> G -> L2 -> M -> Intro
	 service hsdir: C -> G -> L2 -> M -> HSDir
2021-07-12 11:24:58 +03:00
George Kadianakis
9b464cdc36 Add layer2_guard_free() 2021-07-09 17:06:26 +03:00
George Kadianakis
a77727cdca Don't double-pick L2 nodes 2021-07-09 17:06:22 +03:00
Nick Mathewson
9b2d179d95 Merge remote-tracking branch 'tor-gitlab/mr/410' 2021-07-08 14:17:54 -04:00
George Kadianakis
8b026b4eee Merge remote-tracking branch 'tor-gitlab/mr/406' into maint-0.4.6 2021-07-07 13:04:24 +03:00
George Kadianakis
e79d73de9b Merge remote-tracking branch 'tor-gitlab/mr/406' 2021-07-07 13:02:11 +03:00
Cecylia Bocovich
16e517245b Update torrc to encourage use of BridgeDistribution
Bridge operators should generally publish their descriptors except for
rare cases, and instead use the BridgeDistribution none setting to
prevent their bridge from being distributed by BridgeDB.
2021-07-06 13:09:24 -04:00
George Kadianakis
8949317ecc Merge branch 'maint-0.4.6' 2021-07-06 13:52:16 +03:00
George Kadianakis
a522aabd3b Merge branch 'maint-0.4.5' into maint-0.4.6 2021-07-06 13:52:15 +03:00
George Kadianakis
4865eabd18 Merge remote-tracking branch 'tor-gitlab/mr/409' into maint-0.4.5 2021-07-06 13:51:58 +03:00
George Kadianakis
6aff048978 Merge branch 'maint-0.4.6' 2021-07-06 13:42:53 +03:00
George Kadianakis
167f3bc4ec Merge branch 'maint-0.4.5' into maint-0.4.6 2021-07-06 13:42:53 +03:00
George Kadianakis
98b9df61f6 Merge branch 'mr/395' into maint-0.4.5 2021-07-06 13:42:29 +03:00
Nick Mathewson
c1d96358d4 Use native timegm when available.
Continue having a tor_gmtime_impl() unit test so that we can detect
any problems in our replacement function; add a new test function to
make sure that gmtime<->timegm are a round-trip on now-ish times.

This is a fix for bug #40383, wherein we ran into trouble because
tor_timegm() does not believe that time_t should include a count of
leap seconds, but FreeBSD's gmtime believes that it should.  This
disagreement meant that for a certain amount of time each day,
instead of calculating the most recent midnight, our voting-schedule
functions would calculate the second-most-recent midnight, and lead
to an assertion failure.

I am calling this a bugfix on 0.2.0.3-alpha when we first started
calculating our voting schedule in this way.
2021-07-06 13:33:05 +03:00
George Kadianakis
1f87269cf4 Code improvements 2021-07-06 13:22:59 +03:00
Nick Mathewson
2bc02b2199 Suppress a clang 12 warning about "suspicious concatenation".
My clang doesn't like it when we write code like this:

    char *list[] = {
       "abc",
       "def",
       "ghi"
       "jkl"
    }

It wonders whether we meant to put a comma between "ghi" and "jkl"
or not, and gives a warning.

To suppress this warning (since in this case, we did mean to omit
the comma), we just wrap the two strings in parentheses.

Closes #40426; bugfix on 0.4.0.4-rc.
2021-07-01 13:03:19 -04:00
George Kadianakis
52c5b8aa12 Simplify cannibalization logic now that all HS is vanguards
Co-authored-by: Mike Perry <mikeperry-git@torproject.org>
2021-07-01 18:15:55 +03:00
George Kadianakis
9afd9d0940 Special vanguard L3 increased path length does not apply for vanguards-lite
Co-authored-by: Mike Perry <mikeperry-git@torproject.org>
2021-07-01 18:15:55 +03:00
George Kadianakis
0240c00929 Preemptive circuits for HSes should now be vanguard circuits
Co-authored-by: Mike Perry <mikeperry-git@torproject.org>
2021-07-01 18:15:55 +03:00
George Kadianakis
e23947716e Use L2 vanguards during path selection
Co-authored-by: Mike Perry <mikeperry-git@torproject.org>
2021-07-01 18:15:55 +03:00
George Kadianakis
314a6b42c5 Introduce vanguards-lite subsystem and some of its entry points
Co-authored-by: Mike Perry <mikeperry-git@torproject.org>
2021-07-01 18:15:55 +03:00
pedbap
66c5bbb435 Update fuzz_hexdigest.c 2021-07-01 14:37:05 +00:00
pedbap
cb178ab65c Update fuzz_address.c 2021-07-01 14:36:39 +00:00
pedbap
5066f5a608 Update fuzz_addressPTR.c 2021-07-01 14:36:06 +00:00
Nick Mathewson
e71db3a4be Merge remote-tracking branch 'tor-gitlab/mr/405' 2021-07-01 09:56:35 -04:00
pedbap
b31932dfcf Update include.am 2021-07-01 13:16:10 +00:00
Nick Mathewson
2758ae30b3 Bump to 0.4.6.6-dev 2021-06-30 12:01:21 -04:00
Nick Mathewson
2fff1fc835 Update version to 0.4.6.6. 2021-06-30 08:17:56 -04:00
pedbap
7257791874 Adding new fuzzing harnesses for Makefile 2021-06-29 19:31:08 +00:00
pedbap
ad3519c165 tor_addr_parse_PTR_name() isolated harness 2021-06-29 19:15:24 +00:00
pedbap
453ea20827 tor_addr_parse() fuzzing harness 2021-06-29 19:13:38 +00:00
pedbap
a0d65d8275 hexdigest_to_digest() isolated harness 2021-06-29 19:11:45 +00:00
David Goulet
e9edcea0ca Merge branch 'tor-gitlab/mr/275' 2021-06-29 10:55:46 -04:00
David Goulet
f2647295c0 Merge branch 'maint-0.4.5' into maint-0.4.6 2021-06-29 10:41:36 -04:00
David Goulet
23451ef2fe Merge branch 'maint-0.4.6' 2021-06-29 10:41:36 -04:00
David Goulet
301ffb71a6 hs: Send back 0xF6 for a v2 onion address
Fixes #40421

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-06-29 09:56:44 -04:00
Steven Engler
f944e46399 If TestingTorNetwork, skip perm check on the hs directory 2021-06-28 13:51:06 -04:00
Nick Mathewson
fce99957e2 Suppress strict-prototypes warning on NSS pk11pub.h header
We already did this in a couple of places, but there are more that
we didn't get.  This is necessary for systems with versions of
NSS that don't do their prototypes properly.

Fixes #40409; bugfix on 0.3.5.1-alpha.
2021-06-28 09:10:28 -04:00
George Kadianakis
2b97c1dd34 Merge remote-tracking branch 'tor-gitlab/mr/385' 2021-06-28 14:11:46 +03:00
Nick Mathewson
45c8d69cbb Merge branch 'maint-0.4.5' into maint-0.4.6 2021-06-26 10:04:38 -04:00
Nick Mathewson
45b5987115 Merge branch 'maint-0.4.6' 2021-06-26 10:04:38 -04:00
Alexander Færøy
83483bd4f6 Enable deterministic RNG for address set tests.
This patch enables the deterministic RNG for address set tests,
including the tests which uses address set indirectly via the nodelist
API.

This should prevent random test failures in the highly unlikely case of
a false positive which was seen in tor#40419.

See: tpo/core/tor#40419.
2021-06-25 16:43:10 +00:00
David Goulet
270398fa31 Merge branch 'maint-0.4.6' 2021-06-18 14:29:15 -04:00
Alexander Færøy
2c00ad36cd Fix compilation on systems with older compilers.
This patch fixes a build error with GCC 7.x which doesn't seem to accept
const int's as constants in macro initialization.

See: tpo/core/tor#40410
2021-06-18 18:14:07 +00:00
Nick Mathewson
d642da020e Merge remote-tracking branch 'tor-gitlab/mr/338' 2021-06-14 13:10:18 -04:00
Nick Mathewson
982829650c Merge remote-tracking branch 'tor-gitlab/mr/397' 2021-06-14 13:05:03 -04:00
Nick Mathewson
91aec8dbc1 Bump to 0.4.6.5-dev 2021-06-14 11:48:30 -04:00
Nick Mathewson
9085508310 Bump to 0.4.5.9-dev 2021-06-14 11:47:41 -04:00
Nick Mathewson
87492154e0 Bump to 0.3.5.15-dev 2021-06-14 11:45:30 -04:00
George Kadianakis
7034c8449d Implement fuzzing for superencrypted HSv3 desc layer
Here is a corpus:

desc-auth-type x25519
desc-auth-ephemeral-key 68GrIdhTe01n7WfZroM+Uwqzd4N6GpFWgVfperanvDM=
auth-client viYu6HEs7bo ljriJfI9acOhbwhjksBvAg omzl9Hz/XK6fMdifuIAXiw
auth-client SNzxBNMmHiU Mh0Zv0GrGxjFaKr9OG1QNg 9xayJnQoEXsuakxolL54nQ
auth-client Ho28DFsBhTE tBB4ebOhBu95a+3dHEv+Fg XUkBvpJXerGUX/eS3uwXdQ
auth-client 7BHnYML5O20 eMm3Csm92XdR9Mt/Xzy/ug HrEx44IVpQlQBu7tcP4F2g
auth-client xsrAsjgWj/0 5QdhG282mmK35U5BCkqaMg Ops8Lgl+ASOXKnfii7egdA
auth-client 6FO1oPHXwmI mEl0Z5Pn8GLlCNH5xbUeWg 9610jM1OWyASws80exma6Q
auth-client MvOMOF2ynd0 t2TFwq3mj5ZKm8yH6wDEIg hM1wsvG4CTY8X1MLOInIIg
auth-client WJs5l92CN4Y vfmHF82nJ8qmGqJ/DLRTGg g9d51VyUEi9LOsmdQvaQJQ
auth-client 1TiTYG9rpDU xPJPjzHtQYmJTFm8zR1j9Q /Uv+1B5co/86sOKEGJzCqQ
auth-client ZBkeY2qXdTc ir85lASBZRF/pD4PQIK+EQ 2LxDABMvmv86KaNQqzNenQ
auth-client 1AOfLh0KtmI 2+yYUfy1BAKB+PKwMukTrA S1d6QTczWqADotn+yl+2aQ
auth-client xd2xsZiNr3A FWk/SsFrech49gODym+7gA 5ydb7Ji0e7yCNZFlVD4Q5Q
auth-client DQYYX5iSlGA VIV3wSGKIfK1GxF0xxm4dg wdH1bc2zm5dSvCVJX8ZzLg
auth-client 1rqVzmtYgGU aSQbgq+/sF93k5stnA+8KA aAWoQMV0VM262Znc7RCMxw
auth-client sx7Br+mYTp8 b/0rd+9e5Q1zGa79I1O41A jc1sm3lOfujPljWA09Q3ng
auth-client S4C/qS7s5N8 XtRzoNhqQGcrVaeTQqMk2A O4bBlq8d3gopBRMWkpuyeg
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SN75HSEb6aIebk+1AT4S1QtJaPSH0EduIXO++JYAs+jIFKy2c
jCVFlO/LbXl7iCdXurJHpSbMNmZFNUri6zEolENODLwke836jBOKiVrWzLnEMxHI
WDDTpLTYhR3C7sEprpEQm9SX2Eik3WxVb4ZTb7SZFU1y1d4tWnjGu3U1D+vO9wVq
Sss9lDipbkhQ9k4j1/Pqozaxvi8lYLbh3WEjK3Iwpr66Bk6Ai2oRg4b+7vzV4o+6
L47JPJhajdHac0CIlmupyA4eejECS6OpoLDf5Wr/616k3dxM//3kAWGUnXVw9GSo
UF5W8AaKlaGZ6EZk09NyGSFRjEs18z+g5ckviGF0EhZI7ZPWQQmlqWUsL9O0S4GO
ZZ9f0UhNmHEspcugbs7e1yfjwGVyxIBkrmxpkmfHE4Gb47UGlJevg2OvZOPT3wMH
vOds2BtqdT3tuss9k+7hsISGse7isEOb7TN5MHb6yyzqnCUZhp5m3Iag7TUkiyfU
jKH5R13tHqKUoJ2rofWoLO2H5xSfp/lqF9sLd4rJ+Pbjhiuvfwz5copYsuTNL4kB
SPUikHlTxSOgTBYNV77qxpsqOI3+iziCrSqHsxNdlaA1T3fiq6SeZBNdD822AYm9
L5hbcgpDPEEwT/n5kWNbRNueerJkJwboaOnT1ZX1601Pwj5QDi+YM1NYy5PsdWxb
bPGpQyZ+uf917q9gV7Ykr5cic10YD11khAghr0n6fYfb8Ijc22uP6m47KItDqQc1
eFym149F56B0yg5FR85Arg==
-----END MESSAGE-----
2021-06-11 02:00:52 +03:00
Nick Mathewson
ec677c0c2e Merge branch 'maint-0.4.6' 2021-06-10 12:30:30 -04:00
Nick Mathewson
8e590992c4 Merge branch 'maint-0.4.5' into maint-0.4.6 2021-06-10 12:30:29 -04:00
Nick Mathewson
200e9a55e0 Merge branch 'maint-0.4.4' into maint-0.4.5 2021-06-10 12:30:29 -04:00
Nick Mathewson
0ae9fd62fd Merge branch 'maint-0.3.5' into maint-0.4.4 2021-06-10 12:30:11 -04:00
George Kadianakis
f57b5c48e0 Fix TROVE-2021-006: Out-of-bounds read on v3 desc parsing 2021-06-10 12:11:10 -04:00
Nick Mathewson
0667eaa9bf Merge branch 'maint-0.4.6' 2021-06-10 09:55:55 -04:00
Nick Mathewson
7be37a26ac Merge branch 'maint-0.4.5' into maint-0.4.6 2021-06-10 09:55:55 -04:00
Nick Mathewson
ae2254e490 Merge branch 'maint-0.4.4' into maint-0.4.5 2021-06-10 09:55:55 -04:00
Nick Mathewson
014345ed6a Resolve remaining merge conflicts in relay.c
(My bad!)
2021-06-10 09:55:35 -04:00
Nick Mathewson
8734eea31b Merge branch 'maint-0.4.6' 2021-06-10 08:53:07 -04:00
Nick Mathewson
3260d323a6 Merge branch 'maint-0.4.5' into maint-0.4.6 2021-06-10 08:53:07 -04:00
Nick Mathewson
ec696a95e5 Merge branch 'maint-0.4.4' into maint-0.4.5 2021-06-10 08:53:07 -04:00
Nick Mathewson
0f2d45328d Merge branch 'maint-0.3.5' into maint-0.4.4
Conflicts resolved:
	src/core/or/relay.c
2021-06-10 08:52:39 -04:00
David Goulet
adb248b6d6 TROVE-2021-003: Check layer_hint before half-closed end and resolve cells
This issue was reported by Jann Horn part of Google's Project Zero.

Jann's one-sentence summary: entry/middle relays can spoof RELAY_END cells on
half-closed streams, which can lead to stream confusion between OP and
exit.

Fixes #40389
2021-06-10 08:50:05 -04:00
Nick Mathewson
d9edf143ab Merge branch 'maint-0.4.6' 2021-06-10 08:42:15 -04:00
Nick Mathewson
69bd4a8a2d Merge branch 'maint-0.4.5' into maint-0.4.6 2021-06-10 08:42:15 -04:00
Nick Mathewson
1da8621c0a Merge branch 'maint-0.4.4' into maint-0.4.5 2021-06-10 08:42:15 -04:00
Nick Mathewson
31eaa81f59 Merge branch 'maint-0.3.5' into maint-0.4.4 2021-06-10 08:42:15 -04:00
Nick Mathewson
d71bf986b4 Merge branch 'bug40391_035' into maint-0.3.5 2021-06-10 08:41:59 -04:00
Nick Mathewson
085bf61a35 Merge branch 'maint-0.4.6' 2021-06-10 08:37:34 -04:00
Nick Mathewson
1d11675adb Merge branch 'maint-0.4.5' into maint-0.4.6 2021-06-10 08:37:34 -04:00
Nick Mathewson
e2d01aac9e Merge branch 'maint-0.4.4' into maint-0.4.5 2021-06-10 08:37:34 -04:00
Nick Mathewson
7c19a4d924 Merge branch 'maint-0.3.5' into maint-0.4.4 2021-06-10 08:37:26 -04:00
Nick Mathewson
7fdfc2ea54 Merge branch 'bug40390_035_squashed' into maint-0.3.5 2021-06-10 08:34:25 -04:00
Nick Mathewson
c0aa9e0a1b Assert on _all_ failures from RAND_bytes().
Previously, we would detect errors from a missing RNG
implementation, but not failures from the RNG code itself.

Fortunately, it appears those failures do not happen in practice
when Tor is using OpenSSL's default RNG implementation.  Fixes bug
40390; bugfix on 0.2.8.1-alpha. This issue is also tracked as
TROVE-2021-004. Reported by Jann Horn at Google's Project Zero.
2021-06-10 08:33:57 -04:00
Nick Mathewson
a2e500f1ff Merge branch 'maint-0.4.6' 2021-06-10 08:21:49 -04:00
Nick Mathewson
cb38219664 Merge branch 'maint-0.4.5' into maint-0.4.6 2021-06-10 08:21:48 -04:00
Nick Mathewson
d60f8fe98a Merge branch 'maint-0.4.4' into maint-0.4.5 2021-06-10 08:21:48 -04:00
Nick Mathewson
57a41348ee Merge branch 'maint-0.3.5' into maint-0.4.4 2021-06-10 08:21:47 -04:00
Nick Mathewson
520d5c108f Update geoip files to match ipfire location db, 2021/06/10. 2021-06-10 08:20:13 -04:00
Nick Mathewson
d2256fe9ce Modernize our libfuzzer usage to close #40407
Additionally, remove lingering references to hsv2 fuzzers from the
fuzzing_include_am.py script.
2021-06-08 12:47:57 -04:00
Nick Mathewson
88987ce8eb Quick-and-dirty fuzzer for inner-encrypted layer of hsv3 desc.
Based on hsv3 outer-layer fuzzer; some code may be unnecessary.
2021-06-08 11:24:34 -04:00
Nick Mathewson
b3fe9d5162 Bump to 0.4.6.5 2021-06-07 13:32:07 -04:00
Nick Mathewson
c80b98520b Bump to 0.4.5.9. 2021-06-07 13:31:10 -04:00
Nick Mathewson
1956f63d6b Bump to 0.4.4.9 2021-06-07 13:30:18 -04:00
Nick Mathewson
ed7f4ad4a9 Bump to 0.3.5.15. 2021-06-07 13:29:35 -04:00
David Goulet
6994a8d217 Merge branch 'maint-0.4.6' 2021-06-01 08:48:04 -04:00
David Goulet
83009f8003 Merge branch 'tor-gitlab/mr/393' into maint-0.4.6 2021-06-01 08:47:56 -04:00
Nick Mathewson
6ccb858058 Bump to 0.4.6.4-rc-dev 2021-05-28 12:20:48 -04:00
Nick Mathewson
aaf062119e Bump to 0.4.6.4-rc. 2021-05-28 08:04:42 -04:00
Roger Dingledine
896ab165d9 clarify three comments
based on code-spelunking with nickm
2021-05-27 14:22:22 -04:00
Nick Mathewson
fc3d4e4c2f Upgrade and rate-limit compression failure message.
Without this message getting logged at 'WARN', it's hard to
contextualize the messages we get about compression bombs, so this
message should fix #40175.

I'm rate-limiting this, however, since it _could_ get spammy if
somebody on the network starts acting up.  (Right now it should be
very quiet; I've asked Sebastian to check it, and he says that he
doesn't hit this message in practice.)

Closes #40175.
2021-05-27 10:49:37 -04:00
David Goulet
111e6e7f26 Merge branch 'tor-gitlab/mr/359' 2021-05-27 10:12:16 -04:00
David Goulet
c29ba98ce8 Merge branch 'maint-0.4.6' 2021-05-27 10:01:49 -04:00
David Goulet
fd3678fa60 Merge branch 'tor-gitlab/mr/392' into maint-0.4.6 2021-05-27 10:01:44 -04:00
Nick Mathewson
d12b16614d Prefer mmap()ed consensus files over cached_dir_t entries.
Cached_dir_t is a somewhat "legacy" kind of storage when used for
consensus documents, and it appears that there are cases when
changing our settings causes us to stop updating those entries.

This can cause trouble, as @arma found out in #40375, where he
changed his settings around, and consensus diff application got
messed up: consensus diffs were being _requested_ based on the
latest consensus, but were being (incorrectly) applied to a
consensus that was no longer the latest one.

This patch is a minimal fix for backporting purposes: it has Tor do
the same search when applying consensus diffs as we use to request
them.  This should be sufficient for correct behavior.

There's a similar case in GETINFO handling; I've fixed that too.

Fixes #40375; bugfix on 0.3.1.1-alpha.
2021-05-26 13:02:56 -04:00
Alexander Færøy
1665d11942 Merge remote-tracking branch 'tor-gitlab/mr/388' into main 2021-05-25 14:17:12 +00:00
Alexander Færøy
b3d7a56f2a Merge remote-tracking branch 'tor-gitlab/mr/380' into main 2021-05-25 13:58:55 +00:00
Alexander Færøy
11c7e65730 Merge branch 'maint-0.3.5' into maint-0.4.4 2021-05-25 13:25:23 +00:00
Alexander Færøy
4a7379b80a Merge branch 'maint-0.4.4' into maint-0.4.5 2021-05-25 13:25:23 +00:00
Alexander Færøy
bab2b29f89 Merge branch 'maint-0.4.5' into maint-0.4.6 2021-05-25 13:25:23 +00:00
Alexander Færøy
de5f94000c Merge branch 'maint-0.4.6' into main 2021-05-25 13:25:23 +00:00
Nick Mathewson
42ba87d964 Remove the function tor_tls_assert_renegotiation_unblocked.
It was used nowhere outside its own unit tests, and it was causing
compilation issues with recent OpenSSL 3.0.0 alphas.

Closes ticket 40399.
2021-05-25 07:38:31 -04:00
Neel Chauhan
96b59fc4d3 Fix the fencepost issue when we check stability_last_downrated 2021-05-20 11:06:50 -07:00
Nick Mathewson
4c06c619fa Use a more secure hash function for the circuitmux hashtable.
Fixes bug 40931; bugfix on 0.2.4.4-alpha. Also tracked as
TROVE-2021-005.

This issue was reported by Jann Horn from Google's Project Zero.
2021-05-18 08:40:09 -04:00
Nick Mathewson
debede5e50 Merge branch 'maint-0.4.5' into maint-0.4.6 2021-05-17 09:09:49 -04:00
Nick Mathewson
97b61e21a9 Merge remote-tracking branch 'tor-gitlab/mr/387' into maint-0.4.5 2021-05-17 09:09:42 -04:00
Nick Mathewson
fbd47a5078 Merge branch 'maint-0.4.5' into maint-0.4.6 2021-05-17 09:04:22 -04:00
Nick Mathewson
af560f21ec Merge branch 'maint-0.4.6' 2021-05-17 09:04:22 -04:00
Daniel Pinto
e0a8454691 Make SAVECONF keep only one backup and add sandbox rules for it. #40317
When seccomp sandbox is active, SAVECONF failed because it was not
able to save the backup files for torrc. This commit simplifies
the implementation of SAVECONF and sandbox by making it keep only
one backup of the configuration file.
2021-05-17 13:50:19 +02:00
David Goulet
d4fbfb54d4 rephist: Add a counter for the onioniskins stats
Current counters are reset every heartbeat. This commit adds two
counters for the assigned and dropped onionskins that are not reset so
they can be exported onto the MetricsPort.

Closes #40387

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 15:31:44 -04:00
David Goulet
5f009a59da conn: MetricsPort listener is a listener port
The connection type for the listener part was missing from the "is
connection a listener" function.

This lead to our periodic event that retries our listeners to keep
trying to bind() again on an already opened MetricsPort.

Closes #40370

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 15:13:50 -04:00
David Goulet
d4718e4db9 relay: We might be noting down an unknown DNS error type
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 14:44:04 -04:00
David Goulet
3fbd510c52 metrics: One relay metrics was not using metrics_format_label()
This resulted in the labels not being surrounded by double quotes and
thus Prometheus not liking it.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 13:31:40 -04:00
David Goulet
e3f5dc1fd3 metrics: Need to surround label value with double quotes
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 13:24:22 -04:00
David Goulet
22861c2f40 relay: Add TCP port exhaustion metrics
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 11:58:25 -04:00
David Goulet
c6f41d6038 relay: Add DNS metrics
Emit on the MetricsPort all the DNS statistics we have that is the total
number of queries seen and errors per record type.

Related to #40367

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 11:58:25 -04:00
David Goulet
423910e01b dns: Gather DNS request statistics
We now keep track of all errors and total number of request seen. This
is so we can expose those values to the MetricsPort to help Exit
operators monitor the DNS requests and failures.

Related to #40367.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 11:58:25 -04:00
David Goulet
897344fddc relay: Add the global connection limit metrics
This emits two events (read and write) of the total number that the
global connection limit was reached.

Related to #40367

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 11:58:25 -04:00
David Goulet
9040a5475d relay: Add number of open and max sockets metrics
With this commit, a relay will emit metrics that give the total number
of sockets and total number of opened sockets.

Related to #40367

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 11:58:25 -04:00
David Goulet
8bb1874f1e relay: Add the onionskins processing metrics
With this commit, a relay now emits metrics event on the MetricsPort
related to how many onionskins were handled (processed or dropped) for
each handshake type.

Related to #40367

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 11:58:25 -04:00
David Goulet
9c2fa34982 relay: Add the OOM invocation metrics
With this commit, a relay now emits metrics event on the MetricsPort
related to the OOM invocation for:

  - DNS cache
  - GeoIP database
  - Cell queues
  - HSDir caches

Everytime the OOM is invoked, the number of bytes is added to the
metrics counter for that specific type of invocation.

Related to #40367

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 11:58:25 -04:00
David Goulet
bdde4579c2 relay: Code and objects to initialize metrics store
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 11:58:25 -04:00
David Goulet
0cf25fd3a5 relay: Groundwork for relay metrics support
The basic functions for the relay subsystem to expose metrics onto the
MetricsPort.

Part of #40367

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 11:58:25 -04:00
David Goulet
3164e55f01 metrics: Add a reset store helper function
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 11:58:25 -04:00
David Goulet
455471835d metrics: Move helper function to lib/metrics
It is a common function that a lot of subsystem can use which is to
format a label so move it out of the HS subsystem into the more generic
metrics library.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 11:58:25 -04:00
David Goulet
cc2947c007 metrics: Print once the Promtheus comments
An entry can have multiple labels but only print once the comments at
the first one. This follows the Promtheus best practices.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12 11:58:25 -04:00
Nick Mathewson
265cca935a Ignore MAX_BANDWIDTH_CHANGE_FREQ on testing networks.
Part of the ever-growing 40337 fix.
2021-05-11 15:54:14 -04:00
Nick Mathewson
9d7fca2306 Make MinTimeToReportBandwidth a testing-only option (and rename it) 2021-05-11 15:49:00 -04:00
Nick Mathewson
6e140c530c Make client heartbeat stats tied to the heartbeat period.
Patch from cypherpunks. Closes #40330.
2021-05-11 10:08:52 -04:00
Neel Chauhan
35e5b306a0 Fix typo in comment for handle_control_redirectstream() 2021-05-10 19:03:56 -07:00
Nick Mathewson
d82970c8c3 Merge branch 'maint-0.4.6' 2021-05-10 14:30:09 -04:00
Nick Mathewson
8851861ff0 Merge branch 'ticket40374_046' into maint-0.4.6 2021-05-10 14:30:00 -04:00
Nick Mathewson
af6da4a36b Bump to 0.4.6.3-rc-dev 2021-05-10 10:53:39 -04:00
Nick Mathewson
ce8d6d143c Update to 0.4.5.8-dev 2021-05-10 10:53:00 -04:00
Alexander Færøy
9d59d82d40 Remove unused function: dns_randfn_() in dns.c.
This patch unbreaks the current build after tor!369 landed.

See: https://bugs.torproject.org/tpo/core/tor/40371
2021-05-10 13:07:24 +00:00
Alexander Færøy
a56ed0cfa4 Merge remote-tracking branch 'tor-gitlab/mr/369' 2021-05-10 10:58:29 +00:00
Nick Mathewson
e4f2b52deb Merge branch 'maint-0.4.5' into maint-0.4.6 2021-05-07 13:08:25 -04:00
Nick Mathewson
4e62c17114 Merge branch 'maint-0.4.6' 2021-05-07 13:08:25 -04:00
Nick Mathewson
f5acfe6723 Add a sandbox workaround for Glibc 2.33
This change permits the newfstatat() system call, and fixes issues
40382 (and 40381).

This isn't a free change.  From the commit:

    // Libc 2.33 uses this syscall to implement both fstat() and stat().
    //
    // The trouble is that to implement fstat(fd, &st), it calls:
    //     newfstatat(fs, "", &st, AT_EMPTY_PATH)
    // We can't detect this usage in particular, because "" is a pointer
    // we don't control.  And we can't just look for AT_EMPTY_PATH, since
    // AT_EMPTY_PATH only has effect when the path string is empty.
    //
    // So our only solution seems to be allowing all fstatat calls, which
    // means that an attacker can stat() anything on the filesystem. That's
    // not a great solution, but I can't find a better one.
2021-05-07 12:12:11 -04:00
Nick Mathewson
5acf18bfaa Merge branch 'maint-0.4.5' into maint-0.4.6 2021-05-07 10:41:34 -04:00
Nick Mathewson
a4c8591c35 Merge branch 'maint-0.4.6' 2021-05-07 10:41:34 -04:00
Nick Mathewson
7c86f34340 Merge branch 'maint-0.4.4' into maint-0.4.5 2021-05-07 10:41:34 -04:00
Nick Mathewson
48dd87933d Merge branch 'maint-0.3.5' into maint-0.4.4 2021-05-07 10:41:33 -04:00
Nick Mathewson
e2c1ac214c Reindent a few lines to fix a GCC warning.
As of GCC 11.1.1, the compiler warns us about code like this:

     if (a)
         b;
         c;

and that's a good thing: we wouldn't want to "goto fail".  But we
had an instance if this in circuituse.c, which was making our
compilation sad.

Fixes bug 40380; bugfix on 0.3.0.1-alpha.
2021-05-07 10:39:20 -04:00
Nick Mathewson
0397a9cb49 Merge branch 'maint-0.4.5' into maint-0.4.6 2021-05-07 09:53:58 -04:00
Nick Mathewson
1c9890bd31 Merge branch 'maint-0.4.6' 2021-05-07 09:53:58 -04:00
Nick Mathewson
7fe819c951 Merge branch 'maint-0.4.4' into maint-0.4.5 2021-05-07 09:53:58 -04:00
Nick Mathewson
f68aeda549 Merge branch 'maint-0.3.5' into maint-0.4.4 2021-05-07 09:53:57 -04:00
Nick Mathewson
621f8a304a Update geoip files to match ipfire location db, 2021/05/07. 2021-05-07 09:53:46 -04:00
Nick Mathewson
8142b368e7 Bump to 0.4.6.3-rc 2021-05-07 09:42:18 -04:00
Nick Mathewson
ec0b4bdafd Bump to 0.4.5.8. 2021-05-07 09:39:33 -04:00
David Goulet
93af8b1ad8 Merge branch 'maint-0.4.6' 2021-05-07 09:05:21 -04:00
George Kadianakis
80c404c4b7 Log warning when connecting to soon-to-be-deprecated v2 onions. 2021-05-07 08:44:36 -04:00
George Kadianakis
5e836eb80c Add warning when trying to connect to deprecated v2 onions. 2021-05-07 08:41:46 -04:00
George Kadianakis
f230beadf4 Prepare for #40373: Re-introduce parsing for v2 onion addresses.
Welcome back ONION_V2_HOSTNAME! :)
2021-05-05 11:05:45 +03:00
George Kadianakis
d6e7fc00f3 Merge branch 'maint-0.4.6' 2021-05-05 10:21:48 +03:00
David Goulet
cf6e72b702 hs: Fix ADD_ONION with client authorization
Turns out that passing client authorization keys to ADD_ONION for v3 was
not working because we were not setting the "is_client_auth_enabled"
flag to true once the clients were configured. This lead to the
descriptor being encoded without the clients.

This patch removes that flag and instead adds an inline function that
can be used to check if a given service has client authorization
enabled.

This will be much less error prone of needing to keep in sync the client
list and a flag instead.

Fixes #40378

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-04 10:37:26 -04:00
Nick Mathewson
8d0d7a665a Remove NEED_SKEY_1024 parsing.
Only v2 onion services needed this, and they are now gone.

Closes #40374.
2021-04-23 15:55:51 -04:00
David Goulet
1d18ecbc5f Remove HSv2 leftovers after merging #18346
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-04-23 12:54:10 -04:00
David Goulet
3bd7367274 Merge branch 'tor-gitlab/mr/327'
Conflicts:
  src/test/test.c

  Minor comment issue.
2021-04-23 12:48:55 -04:00
George Kadianakis
973fcf056a Merge branch 'maint-0.4.6' 2021-04-23 13:00:24 +03:00
George Kadianakis
f0260c4cea Merge branch 'maint-0.4.5' into maint-0.4.6 2021-04-23 13:00:23 +03:00
David Goulet
8c29729916 hs: Fix memory leak in client cache
Fixes #40356

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-04-21 11:37:46 -04:00
George Kadianakis
32eea3b006 Merge remote-tracking branch 'tor-gitlab/mr/363' into maint-0.3.5 2021-04-21 16:48:22 +03:00
Nick Mathewson
cbf71c4fa7 Merge branch 'maint-0.4.6' 2021-04-19 11:43:39 -04:00
Nick Mathewson
0ceacb5482 Merge branch 'mr_347_squashed' into maint-0.4.6 2021-04-19 11:40:44 -04:00
David Goulet
6281c90885 relay: Emit log warning if Address is internal and can't be used
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-04-19 11:40:30 -04:00
Nick Mathewson
07237b484e Merge remote-tracking branch 'jigsaw/fix-40317_046-saveconf-sandbox-one-backup' 2021-04-19 11:32:21 -04:00
George Kadianakis
7080e748e5 Merge remote-tracking branch 'tor-gitlab/mr/364' 2021-04-19 17:38:16 +03:00
Nick Mathewson
f20f5a4e37 Stop calling evdns_set_random_bytes_fn()
This function has been a no-op since Libevent 2.0.4-alpha, when
libevent got an arc4random() implementation.  Libevent has finally
removed it, which will break our compilation unless we stop calling
it.  (This is currently breaking compilation in OSS-fuzz.)

Closes #40371.
2021-04-16 17:26:59 -04:00
Nick Mathewson
e7c407d927 Bump to 0.4.7.0-alpha-dev 2021-04-15 12:44:26 -04:00
Nick Mathewson
e6d9dd9157 Bump to 0.4.6.2-alpha-dev 2021-04-15 12:42:23 -04:00
Nick Mathewson
96d4466488 Bump version to 0.4.6.2-alpha. 2021-04-14 10:55:48 -04:00
David Goulet
91569c4dad Merge branch 'maint-0.4.5' 2021-04-14 08:39:17 -04:00
David Goulet
bba3393d20 Merge branch 'maint-0.3.5' into maint-0.4.4 2021-04-14 08:39:16 -04:00
David Goulet
30fa80c0fc Merge branch 'maint-0.4.4' into maint-0.4.5 2021-04-14 08:39:16 -04:00
David Goulet
131e2d99a4 fallbackdir: Remove two unspec lines
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-04-14 08:39:04 -04:00
Nick Mathewson
5e6905ed99 Fix test naming, and fix tests on windows.
This is a bugfix against my fix for #40133, which has not yet
appeared in 0.3.5.
2021-04-13 17:38:31 -04:00
Nick Mathewson
8b22c80f56 Clean up the CONNECTION_TESTCASE_ARG macro. 2021-04-13 17:34:03 -04:00
Nick Mathewson
2815721243 Merge branch 'maint-0.4.5' 2021-04-13 17:00:56 -04:00
Nick Mathewson
59bc377dce Merge branch 'maint-0.4.4' into maint-0.4.5 2021-04-13 16:59:16 -04:00
Nick Mathewson
59f6248e09 Merge branch 'maint-0.3.5' into maint-0.4.4 2021-04-13 16:59:15 -04:00
David Goulet
ee7c50b8a7 fallbackdir: Renegerate list with 200 relays
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-04-13 15:15:58 -04:00
Alexander Færøy
705ea32c6e relay: Move "overload-general" from extra-info to server descriptor.
Fixes #40364

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-04-13 15:11:03 -04:00
Nick Mathewson
1f21b6e6a7 Merge branch 'maint-0.4.4' into maint-0.4.5 2021-04-13 10:36:01 -04:00
Nick Mathewson
1b48a28a74 Merge branch 'maint-0.4.5' 2021-04-13 10:36:01 -04:00
Nick Mathewson
b323e6b8c2 Merge branch 'maint-0.3.5' into maint-0.4.4 2021-04-13 10:36:00 -04:00
Nick Mathewson
32f5ad7665 Update geoip files to match ipfire location db, 2021/04/13. 2021-04-13 10:35:50 -04:00
Nick Mathewson
0d63b19afa Merge branch 'maint-0.4.5' 2021-04-13 09:41:13 -04:00
Panagiotis Vasilopoulos
6028b2c10c
tor-resolve: Added notice for .exit domains
Signed-off-by: Panagiotis Vasilopoulos <hello@alwayslivid.com>
2021-04-11 20:24:41 +03:00
David Goulet
218f9f90fb guard: Don't check bridge transport name when selecting eligible guards
This is related to ticket #40360 which found this problem when a Bridge entry
with a transport name (let say obfs4) is set without a fingerprint:

  Bridge obfs4 <IP>:<PORT> cert=<...> iat-mode=0

(Notice, no fingerprint between PORT and "cert=")

Problem: commit 09c6d03246 added a check in
get_sampled_guard_for_bridge() that would return NULL if the selected bridge
did not have a valid transport name (that is the Bridge transport name that
corresponds to a ClientTransportPlugin).

Unfortuantely, this function is also used when selecting our eligible guards
which is done *before* the transport list is populated and so the added check
for the bridge<->transport name is querying an empty list of transports
resulting in always returning NULL.

For completion, the logic is: Pick eligible guards (use bridge(s) if need be)
then for those, initiate a connection to the pluggable transport proxy and
then populate the transport list once we've connected.

Back to get_sampled_guard_for_bridge(). As said earlier, it is used when
selecting our eligible guards in a way that prevents us from selecting
duplicates. In other words, if that function returns non-NULL, the selection
continues considering the bridge was sampled before. But if it returns NULL,
the relay is added to the eligible list.

This bug made it that our eligible guard list was populated with the *same*
bridge 3 times like so (remember no fingerprint):

  [info] entry_guards_update_primary(): Primary entry guards have changed. New primary guard list is:
  [info] entry_guards_update_primary():   1/3: [bridge] ($0000000000000000000000000000000000000000)
  [info] entry_guards_update_primary():   2/3: [bridge] ($0000000000000000000000000000000000000000)
  [info] entry_guards_update_primary():   3/3: [bridge] ($0000000000000000000000000000000000000000)

When tor starts, it will find the bridge fingerprint by connecting to it and
will then update the primary guard list by calling
entry_guard_learned_bridge_identity() which then goes and update only 1 single
entry resulting in this list:

  [debug] sampled_guards_update_consensus_presence(): Sampled guard [bridge] ($<FINGERPRINT>) is still listed.
  [debug] sampled_guards_update_consensus_presence(): Sampled guard [bridge] ($0000000000000000000000000000000000000000) is still listed.
  [debug] sampled_guards_update_consensus_presence(): Sampled guard [bridge] ($0000000000000000000000000000000000000000) is still listed.

And here lies the problem, now tor is stuck attempting to wait for a valid
descriptor for at least 2 guards where the second one is a bunch of zeroes and
thus tor will never fully bootstraps:

  [info] I learned some more directory information, but not enough to build a
  circuit: We're missing descriptors for 1/2 of our primary entry guards
  (total microdescriptors: 6671/6703). That's ok. We will try to fetch missing
  descriptors soon.

Now, why passing the fingerprint then works? This is because the list of
guards contains 3 times the same bridge but they all have a fingerprint and so
the descriptor can be found and tor can bootstraps.

The solution here is to entirely remove the transport name check in
get_sampled_guard_for_bridge() since the transport_list is empty at that
point. That way, the eligible guard list only gets 1 entry, the bridge, and
can then go on to bootstrap properly.

It is OK to do so since when launching a bridge descriptor fetch, we validate
that the bridge transport name is OK and thus avoid connecting to a bridge
without a ClientTransportPlugin. If we wanted to keep the check in place, we
would need to populate the transport_list much earlier and this would require
a much bigger refactoring.

Fixes #40360

Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-04-08 14:08:28 -04:00
George Kadianakis
62614f0b3f Merge remote-tracking branch 'tor-gitlab/mr/354' 2021-04-08 14:37:30 +03:00
George Kadianakis
e0b8a79b2e Merge branch 'maint-0.4.5' 2021-04-08 14:29:08 +03:00