aboutsummaryrefslogtreecommitdiff
path: root/src/core/or
AgeCommit message (Collapse)Author
2023-09-20Bug 40862: Check if circuits are unused more waysMike Perry
2023-08-25Bug #40842: Additional diagnosticsMike Perry
Just in case there are other instances hiding in the maze.
2023-08-25Bug #40842: Don't send on sets that are being torn downMike Perry
2023-08-25Bug #40841: Demote extra legs to protocol warn.Mike Perry
Also add more info to leg dump.
2023-08-23doxygen: Typo fix in relay.c commentDavid Goulet
HTML in comment, what a bad idea... Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-08-23typo: Fix a doxygen html unclosed tagDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-08-22Merge remote-tracking branch 'mbeth-private/ticket40821_mr'David Goulet
2023-08-15Bug 40834: Remove assert and add logs to track no-leg caseMike Perry
2023-08-15Revert "Nullify on_circuit if last conflux leg"Mike Perry
This reverts commit 5487476fd919703b55cb1f1544d575224c9b685e.
2023-08-11Extend DoS protection to IP addresses with known relaysMicah Elizabeth Scott
This exemption used to be helpful in keeping exit relays from tripping the DoS detection subsystem and losing Tor connectivity. Now exit relays block re-entry into the network (tor issue #2667) so it's no longer needed. We'd like to re-enable protection on these addresses to avoid giving attackers a way around our DoS mitigations.
2023-08-09Extend DoS protection to partially-open channelsMicah Elizabeth Scott
tor only marks a channel as 'open' once the TLS and OR handshakes have both completed, and normal "client" (ORPort) DoS protection is not enabled until the channel becomes open. This patch adds an additional earlier initialization path for DoS protection on incoming TLS connections. This leaves the existing dos_new_client_conn() call sites intact, but adds a guard against multiple-initialization using the existing tracked_for_dos_mitigation flag. Other types of channels shouldn't be affected by this patch.
2023-08-02relay: Remove logging for a bug. It triggers a BUG() laterDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-08-01Merge branch 'bug40827' into 'main'David Goulet
Fix assert crash on relay-side due to on_circuit backpointer See merge request tpo/core/tor!737
2023-08-01Bug 40827: Add additional logs and checks for 0-leg conflux caseMike Perry
2023-08-01Nullify on_circuit if last conflux legDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-07-31Bug 40828: Add more log scrubbing to protocol warningsMike Perry
2023-07-17Warn when operating as bridge and exittrinity-1686a
2023-06-27Bug 40566: Remove unused BDP estimatorsMike Perry
2023-06-27Bug 40566: Remove unused congestion control alg structs.Mike Perry
2023-06-27Bug 40566: Unhook unused congestion control algsMike Perry
2023-06-27Bug 40566: Remove unused cc alg filesMike Perry
2023-06-23Export variables and functions for CC unit tests.Mike Perry
2023-06-23Bug 40709: Update and clean up tests for consensus paramsMike Perry
2023-06-23Bug 40709: Update congestion control parametersMike Perry
This brings us into sync with the consensus, and will be useful for test vectors, to ensure behavior consistent with the consensus params.
2023-06-22Bug 40569: Reduce accepted range for negotiated cc_sendme_incMike Perry
2023-06-20Bug 40808: Change KISTSchedRunInterval range and default; add ↵Mike Perry
KISTSchedRunIntervalClient
2023-06-15Bug 40811: Count conflux leg launch attempts early.Mike Perry
Also, double check that the consensus has enough overall exits before attempting conflux set launch.
2023-06-13Bug 40810: Avoid using 0 RTT legsMike Perry
2023-06-13Bug 40810: Improve validation checks to ignore 0-RTT legsMike Perry
Also add calls to dump the legs of a conflux set if we have too many
2023-06-09Bug 40801: Do not change read state of marked connsMike Perry
2023-06-09Bug 40801: Send LINKED_ACK before attaching streamsMike Perry
Otherwise, the BEGIN cell arrives at the exit before it has an RTT, and then it does not know which circuit to prefer in response.
2023-06-09Add BUG() macro to marked edge readsMike Perry
This will give us a full stacktrace.
2023-06-09Add conflux logs to diagnose cases where RTTs are absent/zero.Mike Perry
2023-06-06Add a conflux helper to log conflux sets.Mike Perry
2023-05-24Merge branch 'tor-gitlab/mr/711'David Goulet
2023-05-24token_bucket_ctr: replace 32-bit wallclock time with monotimeMicah Elizabeth Scott
This started as a response to ticket #40792 where Coverity is complaining about a potential year 2038 bug where we cast time_t from approx_time() to uint32_t for use in token_bucket_ctr. There was a larger can of worms though, since token_bucket really doesn't want to be using wallclock time here. I audited the call sites for approx_time() and changed any that used a 32-bit cast or made inappropriate use of wallclock time. Things like certificate lifetime, consensus intervals, etc. need wallclock time. Measurements of rates over time, however, are better served with a monotonic timer that does not try and sync with wallclock ever. Looking closer at token_bucket, its design is a bit odd because it was initially intended for use with tick units but later forked into token_bucket_rw which uses ticks to count bytes per second, and token_bucket_ctr which uses seconds to count slower events. The rates represented by either token bucket can't be lower than 1 per second, so the slower timer in 'ctr' is necessary to represent the slower rates of things like connections or introduction packets or rendezvous attempts. I considered modifying token_bucket to use 64-bit timestamps overall instead of 32-bit, but that seemed like an unnecessarily invasive change that would grant some peace of mind but probably not help much. I was more interested in removing the dependency on wallclock time. The token_bucket_rw timer already uses monotonic time. This patch converts token_bucket_ctr to use monotonic time as well. It introduces a new monotime_coarse_absolute_sec(), which is currently the same as nsec divided by a billion but could be optimized easily if we ever need to. This patch also might fix a rollover bug.. I haven't tested this extensively but I don't think the previous version of the rollover code on either token bucket was correct, and I would expect it to get stuck after the first rollover. Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-05-24Merge branch 'tor-gitlab/mr/709'David Goulet
2023-05-11Add torrc option for conflux client UX.Mike Perry
2023-05-11Fix unit tests.Mike Perry
2023-05-11Clean up UX decision logic; hardcode for browser UX case.Mike Perry
2023-05-11fix minor typos in conflux and pow areasRoger Dingledine
2023-05-10Clean up and disable switch rate limiting.Mike Perry
Switch rate limiting will likely be helpful for limiting OOQ, but according to shadow it was the cause of slower performance in Hong Kong endpoints. So let's disable it, and then optimize for OOQ later.
2023-05-10Remove two conflux algs: maxrate and cwndrate.Mike Perry
Maxrate had slower throughput than lowrtt in Shadow, which is not too surprising. We just wanted to test it.
2023-05-10hs_pow: add per-circuit effort information to control portMicah Elizabeth Scott
This lets controller apps see the outgoing PoW effort on client circuits, and the validated effort received on an incoming service circuit. Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-05-10hs_pow: client side effort adjustmentMicah Elizabeth Scott
The goal of this patch is to add an additional mechanism for adjusting PoW effort upwards, where clients rather than services can choose to solve their puzzles at a higher effort than what was suggested in the descriptor. I wanted to use hs_cache's existing unreachability stats to drive this effort bump, but this revealed some cases where a circuit (intro or rend) closed early on can end up in hs_cache with an all zero intro point key, where nobody will find it. This moves intro_auth_pk initialization earlier in a couple places and adds nonfatal asserts to catch the problem if it shows up elsewhere. The actual effort adjustment method I chose is to multiply the suggested effort by (1 + unresponsive_count), then ensure the result is at least 1. If a service has suggested effort of 0 but we fail to connect, retries will all use an effort of 1. If the suggestion was 50, we'll try 50, 100, 150, 200, etc. This is bounded both by our client effort limit and by the limit on unresponsive_count (currently 5). Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-05-10compute the client-side pow in a cpuworker threadRoger Dingledine
We mark the intro circuit with a new flag saying that the pow is in the cpuworker queue. When the cpuworker comes back, it either has a solution, in which case we proceed with sending the intro1 cell, or it has no solution, in which case we unmark the intro circuit and let the whole process restart on the next iteration of connection_ap_handshake_attach_circuit().
2023-05-10hs: Don't expire RP circuits to HS with PoWDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-05-10hs: Client now solve PoW if presentDavid Goulet
At this commit, the tor main loop solves it. We might consider moving this to the CPU pool at some point. Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-05-04CID 1524707: Quiet coverity noiseMike Perry
2023-05-04CID 1524706: Remove dead assignmentMike Perry