aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-01-21Merge branch 'tor-gitlab/mr/270' into maint-0.4.5David Goulet
2021-01-21log more during consensus voting processRoger Dingledine
Give more visibility to directory authority operators during the consensus voting process. Closes ticket 40245.
2021-01-21dir auths write consensuses to disk after creationRoger Dingledine
This step happens after we make each consensus flavor, and before we worry about sigs or anything. That way if Tor crashes, or if we fail to get enough sigs, we still have a chance to know what consensus we wanted to make.
2021-01-21log more about testing incoming relay descriptorsRoger Dingledine
2021-01-21Merge remote-tracking branch 'tor-gitlab/mr/269' into maint-0.4.5Nick Mathewson
2021-01-21Introduce a new bridge_has_invalid_transport() function.Nick Mathewson
In addition to simplifying callsites a little, this function gives correct behavior for bridges without a configured transport.
2021-01-21Merge remote-tracking branch 'tor-gitlab/mr/268' into maint-0.4.5Nick Mathewson
2021-01-21Merge branch 'tor-gitlab/mr/265' into maint-0.4.5David Goulet
2021-01-20config: Remove Bridge <-> ClientTransportPlugin validationDavid Goulet
This validation was only done if DisableNetwork was off because we would use the global list of transports/bridges and DisableNetwork would not populate it. This was a problem for any user using DisableNetwork which includes Tor Browser and thus leading to the Bug() warning. Without a more in depth refactoring, we can't do this validation without the global list. The previous commit makes it that any connection to a bridge without a transport won't happen thus we keep the security feature of not connecting to a bridge without its corresponding transport. Related to #40106 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-20bridge: Don't initiate connection without a transportDavid Goulet
Don't pick the bridge as the guard or launch descriptor fetch if no transport is found. Fixes #40106 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-20Limit the number of items in the consdiffmgr on Windows.Alexander Færøy
This patch limits the number of items in the consensus diff cache to 64 on the Windows platform. Hopefully, this will allow us to investigate a smarter fix while avoiding the situation reported in tor#24857 where Windows relay operators report Tor using 100% CPU. See: tor#24857
2021-01-19Merge remote-tracking branch 'tor-gitlab/mr/266' into maint-0.4.5Nick Mathewson
2021-01-19Merge remote-tracking branch 'tor-gitlab/mr/261' into maint-0.4.5Nick Mathewson
2021-01-19config: Prioritize port with explicit addressDavid Goulet
When selecting the first advertised port, we always prefer the one with an explicit address. Closes #40246 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-19relay: Keep all ORPorts that are on different portsDavid Goulet
We used to actually discard ORPorts that were the same port and same family but they could have different address. Instead, we need to keep all different ORPorts so we can bind a listener on each of them. We will publish only one of these in our descriptor though. Related to #40246 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-19Merge branch 'maint-0.4.4' into maint-0.4.5Nick Mathewson
2021-01-19Merge branch 'maint-0.4.3' into maint-0.4.4Nick Mathewson
2021-01-19Merge branch 'maint-0.3.5' into maint-0.4.3Nick Mathewson
2021-01-19Remove unnecessary non-fatal assertion.Alexander Færøy
This patch removes a call to `tor_assert_nonfatal()` if `extend_info_from_node()` returns NULL. This is unnecessary as we already handle the case where `info` is NULL in the next `if (!info) { ... }` block in the code. See: tor#32666.
2021-01-15Revert "IPv6 sybil: consider addresses in the same /64 to be equal."David Goulet
This reverts commit d07f17f67685d75fec8a851b3ae3d157c1e31aa3. We don't want to consider an entire routable IPv6 network as sybil if more than 2 relays happen to be on it. For path selection it is very important but not for selecting relays in the consensus. Fixes #40243
2021-01-14relay: Don't BUG() if we can't find authority descriptorDavid Goulet
We can end up trying to find our address from an authority while we don't have yet its descriptor. In this case, don't BUG() and just come back later. Closes #40231 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-14relay: Don't flag that we published if descriptor build failsDavid Goulet
In case building the descriptor would fail, we could still flag that we did in fact publish the descriptors leading to no more attempt at publishing it which in turn makes the relay silent for some hours and not try to rebuild the descriptor later. This has been spotted with #40231 because the operator used a localhost address for the ORPort and "AssumeReachable 1" leading to this code path where the descriptor failed to build but all conditions to "can I publish" were met. Related to #40231 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-13Better fix for #40241 (--enable-all-bugs-are-fatal and fallthrough)Nick Mathewson
This one should work on GCC _and_ on Clang. The previous version made Clang happier by not having unreachable "fallthrough" statements, but made GCC sad because GCC didn't think that the unconditional failures were really unconditional, and therefore _wanted_ a FALLTHROUGH. This patch adds a FALLTHROUGH_UNLESS_ALL_BUGS_ARE_FATAL macro that seems to please both GCC and Clang in this case: ordinarily it is a FALLTHROUGH, but when ALL_BUGS_ARE_FATAL is defined, it's an abort(). Fixes bug 40241 again. Bugfix on earlier fix for 40241, which was merged into maint-0.3.5 and forward, and released in 0.4.5.3-rc.
2021-01-13Merge branch 'mr/252' into maint-0.4.5George Kadianakis
2021-01-13Remove BUG() when checking TOO_MANY_OUTDATED_DIRSERVERS.Nick Mathewson
Fixes bug #40234; bugfix on 0.3.2.5-alpha.
2021-01-12Bump to 0.4.5.3-rc-devNick Mathewson
2021-01-12Merge branch 'ticket40237_044_01' into ticket40237_045_01David Goulet
2021-01-12Merge branch 'ticket40237_043_01' into ticket40237_044_01David Goulet
2021-01-12tests: Fix unit tests after merge of #40237David Goulet
2021-01-12Merge branch 'ticket40237_035_01' into ticket40237_043_01David Goulet
2021-01-12hs-v3: Require reasonably live consensusDavid Goulet
Some days before this commit, the network experienced a DDoS on the directory authorities that prevented them to generate a consensus for more than 5 hours straight. That in turn entirely disabled onion service v3, client and service side, due to the subsystem requiring a live consensus to function properly. We know require a reasonably live consensus which means that the HSv3 subsystem will to its job for using the best consensus tor can find. If the entire network is using an old consensus, than this should be alright. If the service happens to use a live consensus while a client is not, it should still work because the client will use the current SRV it sees which might be the previous SRV for the service for which it still publish descriptors for. If the service is using an old one and somehow can't get a new one while clients are on a new one, then reachability issues might arise. However, this is a situation we already have at the moment since the service will simply not work if it doesn't have a live consensus while a client has one. Fixes #40237 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-11Merge branch 'maint-0.4.3' into maint-0.4.4Nick Mathewson
2021-01-11Merge branch 'maint-0.4.4' into maint-0.4.5Nick Mathewson
2021-01-11Merge branch 'maint-0.3.5' into maint-0.4.3Nick Mathewson
2021-01-11Fix warnings in current debian-hardened CI.Nick Mathewson
We're getting "fallback annotation annotation in unreachable code" warnings when we build with ALL_BUGS_ARE_FATAL. This patch fixes that. Fixes bug 40241. Bugfix on 0.3.5.4-alpha.
2021-01-11Increment version to 0.4.5.3-rcNick Mathewson
2020-12-21relay: Log address suggested by directory authoritiesDavid Goulet
If we get an address suggestion from a directory authority and we have no address configured or discovered, log it at notice level so the operator can learn what address will be used by Tor. Fixes #40201 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-12-21Merge branch 'mr_240_squashed' into maint-0.4.5Nick Mathewson
2020-12-21test: Fix memleak in test/load_stats_fileDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-12-21Fix timestamp parser in new load_stats_file.Karsten Loesing
The previous parser only considered stats files _starting_ with the timestamp tag, not stats files having the timestamp tag in a later position. While this applies to all current stats files, a future stats file might look differently. Better to fix the function now than be surprised in another 9 years from now. This commit also adds a test case for such future stats, and it fixes stats file paths in newly added unit tests.
2020-12-21relay: Report the entire content of a stats fileDavid Goulet
It turns out that 9 years ago, we stopped appending data into stats file and rather overwrite everytime we have new stats (see commit a6a127c833eace1100aca7ab8ad118862bb8a8b9) The load_stats_file() function was still thinking that we could have the same line many times in the file which turns out to be false since 9 years ago. However, that did not cause problem until IPv6 connection stats came along which introduced a new line in conn-stats: "ipv6-conn-bi-direct ...". Before, that file contained a single line starting with the tag "conn-bi-direct". That very tag appears also in the IPv6 tag (see above) so the load_stats_file() function would consider that the IPv6 line as the last tag to be appeneded to the file and fail to report the line above (for IPv4). It would actually truncate the IPv6 line and report it (removing the "ipv6-" part). In other words, "conn-bi-direct" was not reported and instead "ipv6-conn-bi-direct" was used without the "ipv6-" part. This commit refactors the entire function so that now it looks for a "timestamp tag" to validate and then if everything is fine, returns the entire content of the file. The refactor simplifies the function, adds logging in case of failures and modernize it in terms of coding standard. Unit tests are also added that makes sure the loaded content matches the entire file if timestamp validation passes. Fixes #40226 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-12-17Merge branch 'tor-gitlab/mr/243' into maint-0.4.5David Goulet
2020-12-17Fix Keccak undefined behavior on exotic platforms.George Kadianakis
Bug reported and diagnosed in: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=975977 Fixes bug #40210.
2020-12-16Merge branch 'tor-gitlab/mr/234' into maint-0.4.5Alexander Færøy
2020-12-16config: Catch missing Bridge for ClientTransportPluginDavid Goulet
When making sure we have a Bridge line with a ClientTransportPlugin, we now check in the managed proxy list and so we can catch any missing ClientTransportPlugin for a Bridge line. Fixes #40106 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-12-15Merge branch 'tor-gitlab/mr/239' into maint-0.4.5David Goulet
2020-12-15Merge remote-tracking branch 'tor-gitlab/mr/205' into maint-0.4.5George Kadianakis
2020-12-14Socks5: handle truncated client requests correctlyNick Mathewson
Previously, our code would send back an error if the socks5 request parser said anything but DONE. But there are other non-error cases, like TRUNCATED: we shouldn't send back errors for them. This patch lowers the responsibility for setting the error message into the parsing code, since the actual type of the error message will depend on what problem was encountered. Fixes bug 40190; bugfix on 0.3.5.1-alpha.
2020-12-08Avoid sandbox bug warning when unglobbing patterns #40094Daniel Pinto
Adds a more user-friendly error message when the configuration is reloaded and a new %include is added that makes its unglobbing access files/folders not allowed by the seccomp sandbox.
2020-12-08Fix a couple of documentation comments related to #40094Nick Mathewson